File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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' )
You can’t perform that action at this time.
0 commit comments