python - How to get correct GMT `last_modifed` of AWS S3 key using `boto` API? -


when using get_key , fetching last_modified property, there deviation of 3 hours.

k = b.get_key('av-bait/modules/reporters.py') print k.last_modified     

i get: 'sat, 17 may 2014 18:42:02 gmt', while file updated @ 21:42:02 following picture indicates:

file shown in se console

any idea how fetch gmt via s3?

thanks

if want adjust string 3 hours can use:

>>> t='sat, 17 may 2014 18:42:02 gmt' >>> datetime import datetime >>> str_time= datetime.strptime(t,'%a, %d  %b %y %h:%m:%s gmt') >>> updated_time= str_time.replace(hour=str_time.hour+3) >>> print updated_time 2014-05-17 21:42:02 

there many ways it, have @ datetime docs,


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -