We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25ed9e4 commit 14b65e2Copy full SHA for 14b65e2
1 file changed
process.py
@@ -83,7 +83,7 @@
83
article['agencies'] = [agency['name'] for agency in article['agencies']]
84
85
# adjust timezone info into UTC time
86
- article['created_at'] = article['created_at'][:-3] + "00" # %z only accepts `-0400` instead of `-04:00` in Python3.6
+ article['created_at'] = article['created_at'][:-3] + article['created_at'][-2:] # %z only accepts `-0400` instead of `-04:00` in Python3.6
87
created_at = datetime.strptime(article['created_at'], '%Y-%m-%dT%H:%M:%S.%f%z').astimezone(timezone.utc)
88
article['created_at'] = created_at.strftime('%Y-%m-%dT%H:%M:%S.%f')
89
date_key = created_at.date().strftime('%Y%m%d')
0 commit comments