-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtime_reformat.py
31 lines (22 loc) · 1.22 KB
/
time_reformat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from datetime import date, timedelta
reference_date = date(2011, 1, 1)
days = [734518, 734549, 734577, 734608, 734638, 734669, 734699, 734730, 734761,
734791, 734822, 734852, 734883, 734914, 734943, 734974, 735004, 735035,
735065, 735096, 735127, 735157, 735188, 735218, 735249, 735280, 735308,
735339, 735369, 735400, 735430, 735461, 735492, 735522, 735553, 735583,
735614, 735645, 735673, 735704, 735734, 735765, 735795, 735826, 735857,
735887, 735918, 735948, 735979, 736010, 736038, 736069, 736099, 736130,
736160, 736191, 736222, 736252, 736283, 736313, 736344, 736375, 736404,
736435, 736465, 736496, 736526, 736557, 736588, 736618, 736649, 736679,
736710, 736741, 736769, 736800, 736830, 736861, 736891, 736922, 736953,
736983, 737014, 737044, 737075, 737106, 737134, 737165, 737195, 737226,
737256, 737287, 737318, 737348, 737379, 737409, 737440, 737471, 737499,
737530, 737560, 737591, 737621, 737652, 737683, 737713, 737744, 737774,
737805, 737836, 737865, 737896, 737926, 737957, 737987, 738018, 738049,
738079, 738110, 738140,]
offset_days = [day - days[0] for day in days]
time = []
for day in offset_days:
monyr = reference_date+timedelta(days=day)
monyr = monyr.strftime('%Y-%m')
time.append(monyr)