simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
2.93k stars 316 forks source link

make date-format CSV rule understand more timezone names #1547

Open simonmichael opened 3 years ago

simonmichael commented 3 years ago

Reported on chat: a CSV date containing the time zone "Mountain Daylight Time" can't be parsed by hledger CSV rules.

https://hledger.org/hledger.html#date-format understands the date format codes provided by https://hackage.haskell.org/package/time-1.11.1.2/docs/Data-Time-Format.html#v:formatTime. One of these is %Z, which currently supports only a limited set of names, cf https://hackage.haskell.org/package/time-1.11.1.2/docs/Data-Time-Format.html#v:defaultTimeLocale:

only the ten time-zones mentioned in RFC 802 sec. 5: "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT". Note that the parsing functions will regardless parse "UTC", single-letter military time-zones, and +HHMM format.

We could construct a locale with a more complete set of names, cf https://en.wikipedia.org/wiki/List_of_tz_database_time_zones, which would allow date-format to handle more real-world CSV dates.

advancedAlpaka commented 12 months ago

Sorry, is this issue actual, right? Could I make somewhat in this area?

simonmichael commented 11 months ago

@advancedAlpaka hi, yes this is still a limitation. Have you seen it cause a problem in your usage ?

simonmichael commented 11 months ago

(Yes, help with this is welcome.)