I am looking for a locale with a particular set of features. Using this simple script I can see the date format of any installed locale.

 LC_TIME=$1 date +%x

That's fine. But locales control other features and I want to see them too. In my current issue, I want Thunderbird list dates to show as 2018/06/30 and I want my panel clock to show the time in 12-hour format.

How can I add to this script to display the other effects of the locale?

  • 1
    The application may ignore the settings, but all of the information it might use is in man 7 locale. – Thomas Dickey Jun 30 '18 at 22:54

I think date +'full="%c" date="%x" time_24="%X" time_12="%r"' shows you everything there is to know about the LC_TIME setting except for the names of months and the am/pm string that isn't current.

If you want to see all the settings of a locale, check the documentation of the localedef utility to see if it suggests directories containing input files. For example, on my system (Ubuntu), it lists

          Usual default path for locale definition files.

And I can go and read locale definitions by reading files in this directory.

It's up to each application whether it actually uses the locale settings. Some have their own configuration mechanism that can override locale settings, and some ignore locale settings altogether.

Thunderbird does show dates according to the LC_TIME setting. If you've set LC_TIME and it doesn't appear to have an effect in Thunderbird, make sure you're setting it in the right place: not in .bashrc, because that doesn't affect programs started from a GUI menu. Put environment variable definitions in a file such as ~/.profile or ~/.pam_environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.