System.CurrentLocale.currentLocale :: IO TimeLocale
from the current-locale package looks appropriate.
I have not tested. Considering the source code, it should work. I really donβt really like it, since four date (!) Subprocesses appear under it, Which is pretty tedious for this simple task, IMHO.
It may be possible to rewrite it to use some C or POSIX functions.
source share