gukoff / dtparse

Fast datetime parser for Python written in Rust
MIT License
74 stars 2 forks source link

Wanna be able to parse dates without seconds, minutes, hours. #1

Open chasylexus opened 6 years ago

chasylexus commented 6 years ago

Is it possible to add compatibility with strings without the time part for fuller compatibility with datetime library and more helpful usage in different applications where datetime format could be partially unexpected?

gukoff commented 6 years ago

I think that's possible.

If the pattern doesn't contain hours, we can e.g. add $%H to it and $00 to the datetime string (here $ is nothing but a sentinel).

This looks dirty though. And I'm not sure if this would be useful, because compatibility isn't the goal of the library: chrono's specifiers are different from Python's anyway.

I'm going to consider this after #2 and #3.