开发者

Python timezone issue?

开发者 https://www.devze.com 2022-12-31 06:43 出处:网络
im having troubles with parsing开发者_运维问答 a feed and getting the time.i am using dateutil.parser

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


"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.

0

精彩评论

暂无评论...
验证码 换一张
取 消