scrapinghub / dateparser

python parser for human readable dates
BSD 3-Clause "New" or "Revised" License
2.55k stars 465 forks source link

Two ISO-8601 variants don't parse #914

Open absurd34 opened 3 years ago

absurd34 commented 3 years ago

Hi!

[version 1.0.0-1 (Debian).]

These variants of ISO-8601 (as produced by coreutil's date) for some reason don't parse:

python3 -c "import dateparser; print(dateparser.parse('$(date --iso-8601=hours)'));" python3 -c "import dateparser; print(dateparser.parse('$(date --iso-8601=ns)'));"

(All other variants as described in date's man page work fine.)

Thx!

S

Gallaecio commented 3 years ago

Example dates:

2021-04-29T06+02:00
2021-04-29T06:38:49,946902974+02:00

(I haven’t verified that they don’t work, but I suspect we may not support the T separator at the moment.)

absurd34 commented 3 years ago

Hi,

the other variants (also having the "T"-separator) work however. For example

python3 -c "import dateparser; print(dateparser.parse('$(date --iso-8601=seconds)'));"

which would be a date string like 2021-04-29T07:27:54+02:00.

Hth!

S