Skip to content

Commit 5917992

Browse files
committed
Add comment
1 parent 14b65e2 commit 5917992

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

process.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@
8282
article['states'] = states
8383
article['agencies'] = [agency['name'] for agency in article['agencies']]
8484

85-
# adjust timezone info into UTC time
85+
# search using `created_at` returns all with UTC time between 00:00-23:59 in a single day,
86+
# so it include some articles created at 20:00-00:00 in EST of the "previous day" (-04:00).
87+
# Adjust timezone info of `created_at` field into UTC time to avoid overwriting the previous day file
8688
article['created_at'] = article['created_at'][:-3] + article['created_at'][-2:] # %z only accepts `-0400` instead of `-04:00` in Python3.6
8789
created_at = datetime.strptime(article['created_at'], '%Y-%m-%dT%H:%M:%S.%f%z').astimezone(timezone.utc)
8890
article['created_at'] = created_at.strftime('%Y-%m-%dT%H:%M:%S.%f')

0 commit comments

Comments
 (0)