Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recognize UTC timestamps #281

Open
anarcat opened this issue Mar 24, 2022 · 0 comments
Open

recognize UTC timestamps #281

anarcat opened this issue Mar 24, 2022 · 0 comments

Comments

@anarcat
Copy link

anarcat commented Mar 24, 2022

this might seem weird, but I think those two should be different:

>>> import parsedatetime; "{}".format(parsedatetime.Calendar().parseDT("next tuesday 18:00", tzinfo=pytz.timezone("CET"))[0])
'2022-03-29 18:00:00+02:00'
>>> import parsedatetime; "{}".format(parsedatetime.Calendar().parseDT("next tuesday 18:00 UTC", tzinfo=pytz.timezone("CET"))[0])
'2022-03-29 18:00:00+02:00'
>>> 

ie. if I specifically pass a timezone in my date string, shouldn't parsedetime at least try to parse that timestamp?

this also fails with more regular date formats:

>>> import parsedatetime; "{}".format(parsedatetime.Calendar().parseDT("2022-03-03 18:00 UTC", tzinfo=pytz.timezone("CET"))[0])
'2022-03-03 18:00:00+01:00'
>>> import parsedatetime; "{}".format(parsedatetime.Calendar().parseDT("2022-03-03 18:00 UTC", tzinfo=pytz.timezone("EST"))[0])
'2022-03-03 18:00:00-05:00'
>>> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant