tanghongbin 5 years ago
parent
commit
f8f1d0a914
1 changed files with 19 additions and 3 deletions
  1. 19 3
      AnsjerPush/test.py

+ 19 - 3
AnsjerPush/test.py

@@ -1,5 +1,21 @@
+import time
+
 import boto3
 import boto3
 
 
-client = boto3.client('cloudwatch')
-response = client.get_dashboard()
-print(response)
+from AnsjerPush.config import AWS_SES_ACCESS_ID, AWS_SES_ACCESS_SECRET
+
+# client = boto3.client('cloudwatch', region_name='us-east-1', aws_access_key_id=AWS_SES_ACCESS_ID, aws_secret_access_key=AWS_SES_ACCESS_SECRET)
+# response = client.get_dashboard(DashboardName='string')
+# print(response)
+
+localtime = time.localtime()
+current_month = localtime.tm_mon
+print(current_month)
+
+time_struct = [localtime.tm_year, localtime.tm_mon, 1, 0, 0, 0, 0, 0, 0]
+start_time = int(time.mktime(tuple(time_struct)))
+print(start_time)
+
+time_struct[1] = current_month + 1
+end_time = int(time.mktime(tuple(time_struct)))
+print(end_time)