|
@@ -25,8 +25,7 @@ def datetime_now():
|
|
|
|
|
|
mysql = {'database': 'sagacloud_review', 'host': 'rm-2zek656j2bn934176xo.mysql.rds.aliyuncs.com', 'passwd': 'H%k3!BHw1kQXIc70', 'port': 53306, 'user': 'root'}
|
|
|
|
|
|
-start_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-2)).strftime("%Y%m")+"01"
|
|
|
-end_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-1)).strftime("%Y%m")+"01"
|
|
|
+
|
|
|
# print(start_date_month,end_date_month)
|
|
|
|
|
|
# start_date_month = "20230301"
|
|
@@ -37,7 +36,10 @@ def job():
|
|
|
else:
|
|
|
# 连接mysql
|
|
|
MysqlUtil = MysqlUtils(**mysql)
|
|
|
-
|
|
|
+ start_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-2)).strftime(
|
|
|
+ "%Y%m") + "01"
|
|
|
+ end_date_month = (datetime.datetime.now() + dateutil.relativedelta.relativedelta(months=-1)).strftime(
|
|
|
+ "%Y%m") + "01"
|
|
|
days = get_day_1(start_date_month, end_date_month)
|
|
|
for date in days:
|
|
|
print("%s 开始导入%s的数据"%(datetime_now(),date))
|