parsedatetime
parsedatetime copied to clipboard
Support parsing iso8601 dates
YYYY-MM-DD or YYYY-MM-DDThh:mm:ssTZD formats
>>> import parsedatetime as pdt
>>> cal = pdt.Calendar()
>>> cal.parse('1999-12-24')
(time.struct_time(tm_year=2013, tm_mon=4, tm_mday=4, tm_hour=14, tm_min=2, tm_sec=49, tm_wday=3, tm_yday=94, tm_isdst=1), 0)
YYYY-MM-DD is now supported in the latest commit in the master branch, but I was not able to figure out the best way to handle the time and time zone component. The date-only format is handled in a locale-agnostic way since this is meant to be an international date format.
Possibly a related bug? #133
I would like this also. Based on the discussion in #97, parsedatetime is not timezone aware, so it can't fully support ISO 8601.
Is there any way to specify the date format that parser should only understand, Like it should consider only DD/MM/YYYY but not MM/DD/YYYY ?