How to configure the clock date format to ISO 8601 in Unity? [duplicate]
Solution 1:
There's no easy way to do it in the GUI. One can either use dconf-editor
(which is GUI-ish), and edit two keys in /com/canonical/indicator/datetime
(time-format
to custom
, and custom-time-format
to the desired strftime
directives, in your case %F %R
(or, equivalently, %Y-%m-%d %H:%M
)), or do it directly from the terminal with the following two commands (which, just to be clear, change the same keys):
dconf write /com/canonical/indicator/datetime/time-format "'custom'"
dconf write /com/canonical/indicator/datetime/custom-time-format "'%F %R'"
Note that the doubled quotes are necessary due to dconf's idiosyncracies. (For clarity, I'm referring to the nesting of single quotes ('
) inside double quotes ("
).) Note also that to include seconds, one can replace %R
with %T
.
I do not recall which release started including the dconf tools by default, so if they are unavailable, simply install the dconf-tools
package and proceed.
Update 2016-05-17: While the above should still work, as a matter of principle it's probably better to access the dconf database via gsettings set
than dconf write
-- same database, but a tool more intended for end-users. The corresponding GUI-ish tool remains dconf-editor
.