I've noticed that the en_AU locale is defaulting to 24 hour time, it should be 12 hour as this is most commonly used in Australia.
How can this be adjusted?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
The link Rohit provides has the answer, and it's a good one (I used it myself, and upvoted it). However, in the spirit of this, and particularly in case the link Rohit provided goes away, I'm going to write out the answer in full.
Note: this should still be considered Rohit's answer; I'm just transferring it here for posterity.
One way to do what you want would be, as Mitch says, to change your locale to one that uses the time format that you would like. However, that may entail getting other changes that you aren't interested in (Rohit's article has more on this).
More selectively, you can create a custom locale definition file with the format you want, like so:
Change directory to /usr/share/i18n/locales:
This directory contains locale files. The filenames are in the format <ll>_<CC> where ll is a language code (e.g. 'en' for English) and CC is a country code (e.g. US for the U.S. or AU for Australia). The idea is to customize the one you're already using (e.g. probably en_AU for the original poster - I'll use that as the example).
Copy the existing file to a new file (so that you don't lose the original settings):
sudo cp en_AU en_AU_custom
You need to use
sudo because it's a root-permissions file.
Check the manual for the
date command to figure out exactly what format you want for your time display:
The manual says:
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
which I'll use for this example. To use a different format, just adapt the following instructions accordingly.
Convert your format text into Unicode. You can look up the Unicode equivalent for each character from a site like http://unicode-table.com/en/ , which tells us that
Edit your new file (the one you created in step 2) with your favourite editor (gedit in the example). It's still a root-permissions file, so you'll still need to use
sudo gedit en_AU_custom
Find the section marked LC_TIME and within that, the line starting with t_fmt, which indicates the time format.
Change the format to the unicode equivalent of your preferred time format, being sure to put it in quotes. For this example, the line should look something like this:
Save the file and exit your text editor.
You now have a custom locale in the file you created (
en_AU_custom in the example above).
Compile your new locale file into a system-readable locale definition with the localedef command (being sure to substitute your own filename if you used a different one from the example):
sudo localedef -f UTF-8 -i en_AU_custom en_AU_custom.UTF-8
↑ ↑ ↑
charmap your file locale definition name
Now the new custom locale is available to the system.
Configure the system to use the new custom locale:
a) edit the file /etc/environment:
sudo gedit /etc/environment
b) add (or, if one exists, modify) the line that defines which locale to use for time/date (the file you created in step 9):
Save the file and exit your text editor.
Log out and back in to see your new format being applied.
Note: You can use the same process to modify the date/time format (
d_t_fmt), date format (
d_fmt), am/pm format (
am_pm), standard 12 hour notation (
t_fmt_ampm), and many other locale settings.
Got to the symbol at the bar at the top of your screen where the time is displayed and click. Go to 'Time and Date Settings' (or similar). A settings screen will pop up. Choose the 'Clock' tab.
Alternatively go to System Settings, then Choose 'Time and Date' and then the 'Clock' tab.
You can now choose between 12 and 24 hour day.
To check which locale you currently have as your default
Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the commands below.
Changing the default locale is a little different on Ubuntu compared to most Linux distros, these are the steps we needed to go through to get it changed Click Here