Tutorial :Python timezone issue?



Question:

im having troubles with parsing a feed and getting the time. i am using dateutil.parser

from dateutil.parser import parse    print updated, parse(updated ), parse( updated ).utcoffset()  

this should be a time in cali, output

2010-05-20T11:00:00.000-07:00 2010-05-20 11:00:00.000000-07:00 -1 day, 17:00:00  

why is the offset -1 day 17 hours?

this is causing me issues when i try to do things with it


Solution:1

"Minus 7 hours" is equal to "minus 1 day, plus 17 hours". So probably the time zone offset is correct and just displayed in a weird way.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »