|
@@ -15,27 +15,29 @@ class ReportPublicFunsUtils:
|
|
|
month = str(month) if month > 9 else '0' + str(month)
|
|
|
first_day_of_month = str(year) + '-' + month
|
|
|
if type:
|
|
|
- return [first_day_of_month + '-01 00:00:00', now_time.strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
+ return [first_day_of_month + '-01 00:00:00', ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
else:
|
|
|
- return [first_day_of_month + '-01', now_time.strftime('%Y-%m-%d')]
|
|
|
+ return [first_day_of_month + '-01', ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d')]
|
|
|
|
|
|
@staticmethod
|
|
|
- def get_prd_day(type=None):
|
|
|
+ def before_day():
|
|
|
now_time = datetime.datetime.now()
|
|
|
pre_time = now_time + datetime.timedelta(days=-1)
|
|
|
- now_time = now_time + datetime.timedelta(days=-1)
|
|
|
+ return pre_time
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def get_prd_day(type=None):
|
|
|
if type:
|
|
|
- return [pre_time.strftime('%Y-%m-%d %M:%I:%S'), now_time.strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
+ return [ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d %M:%I:%S'), ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
else:
|
|
|
- return [pre_time.strftime('%Y-%m-%d'), now_time.strftime('%Y-%m-%d')]
|
|
|
+ return [ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d'), ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d')]
|
|
|
|
|
|
@staticmethod
|
|
|
def get_all_time_data_range(type=None):
|
|
|
- now_time = datetime.datetime.now()
|
|
|
- if not type:
|
|
|
- return ['2020-02-18 00:00:00', now_time.strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
+ if type:
|
|
|
+ return ['2020-02-18 00:00:00', ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d %M:%I:%S')]
|
|
|
else:
|
|
|
- return ['2020-02-18', now_time.strftime('%Y-%m-%d')]
|
|
|
+ return ['2020-02-18', ReportPublicFunsUtils.before_day().strftime('%Y-%m-%d')]
|
|
|
|
|
|
@staticmethod
|
|
|
def get_montho_day():
|
|
@@ -72,4 +74,4 @@ class ReportPublicFunsUtils:
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
- print(ReportPublicFunsUtils.get_month())
|
|
|
+ print(ReportPublicFunsUtils.get_prd_day())
|