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

Wrong datetime return #21

Open
vetal4444 opened this issue May 6, 2015 · 6 comments
Open

Wrong datetime return #21

vetal4444 opened this issue May 6, 2015 · 6 comments

Comments

@vetal4444
Copy link

In [1]: import isodate

In [2]: isodate.parse_datetime("04-05-2015T14:32:00Z-09:00")
Out[2]: datetime.datetime(401, 1, 1, 14, 32, tzinfo=<isodate.tzinfo.Utc object at 0x7fd4b4c46080>)

@gweis
Copy link
Owner

gweis commented May 6, 2015

Hi,

"04-05-2015T14:32:00Z-09:00" this is a malformed iso date string.

The order of year, month, day is incorrect, and you have two time zone specifications in it 'Z' and '-09:00'.

I'll try to let the parser raise an exception.

@gweis
Copy link
Owner

gweis commented Jul 6, 2017

Releated to #15

@estein-de
Copy link

Related- timezones don't seem to ever parse, except for the Z timezone specification. This is an example, tested against isodate 0.6.0:

>>> isodate.parse_datetime("2019-03-20T13:30:00-5:00")
datetime.datetime(2019, 3, 20, 13, 30)

This should be returning a non-naive datetime with tzinfo on it, but it returns a naive datetime anyway.

Not that it should matter but America/Chicago is the local timezone of the system.

Is this project still maintained @gweis?

@gweis
Copy link
Owner

gweis commented Mar 20, 2019

@estein-de This is malformed TZ spec. it should be "2019-03-20T13:30:00-05:00" (two digit hours in TZ spec. (so still related to #15)

Ad maintenance: It is still sort of maintained. There are a couple of issues I'd like to address, but I am a bit low on free time currently.

@estein-de
Copy link

Oh thanks , #15 does seem like what I want - because then I would know it was malformed, the scary part is invalid data being misinterpreted

@estein-de
Copy link

Can confirm, working fine with 2 digit hour

>>> isodate.parse_datetime("2019-03-20T13:30:00-05:00")
datetime.datetime(2019, 3, 20, 13, 30, tzinfo=<FixedOffset '-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

3 participants