dateutils
dateutils copied to clipboard
Not able to use dconv for some months
Hi,
if I run echo "aprile" | dconv --from-locale it_IT -i "%B" | dateconv -f "%m" I have 04.
If I choose "luglio" - july in Italian - and run echo "luglio" | dconv --from-locale it_IT -i "%B", I have
dconv: cannot make sense of `luglio' using the given input formats
What's wrogn in my command?
I'm using dateconv 0.4.7.git21.0a82108.
Thank you
Hi Andrea,
thanks for the report. You can have a long explanation or a short work around:
$ echo "luglio 1" | dconv --from-locale it_IT -i "%B %d"
2021-07-01
The problem is an optimisation for the sed-mode (-S) that does not like text-only specifiers in conjunction with custom locales.
Thank you very much.
But why does it work for "aprile"?
The details are a bit complex but dconv looks for (a static set of) letters/characters that demark month names. This set is optimised for the English month names. If, however, numeric specifieres are in the format string it prefers those.
I have closed the issue, because your solution works for my goal.
please choose whether to leave it open
I know, thank you. I might try and fix it though.