This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import sys | |
| import subprocess | |
| DB_LIST = ['db14', 'db15', 'db16', 'db17', 'db18', 'db19'] | |
| USER = 'YOUR_USERNAME' | |
| version = sys.version[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_natual_month(start_date, end_date): | |
| """ | |
| 计算两个日期之间的自然月。 | |
| :param start_date: | |
| :param end_date: | |
| :return: | |
| """ | |
| start_date, end_date = int(start_date), int(end_date) | |
| s_year, s_month, s_day = start_date / 10000, (start_date % 10000) / 100, start_date % 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def get_natural_weeks(start_ymd, end_ymd, ledge=False, redge=False): | |
| """ | |
| 获得中间的自然周。 | |
| :param start_ymd: 起始日期 | |
| :param end_ymd: 截止日期 | |
| :param ledge: 是否包含起始日期所在周 | |
| :param redge: 是否包含截止日期所在周 | |
| :return: 起始时间和截止时间之间所有的周。例:[[MON_1, SUN_1], [MON_2, SUN_2], ……] | |
| """ |