Custom Date Display in Unity Desktop (and probably some others)
I found that the date and time displayed by Unity Desktop can be customised.
- In dconf-editor (or in the terminal) com.indicator.datetime contains many options about date formatting.
- Set time-format to custom. This allows custom-time-format to be used for formatting.
- Set custom-time-format to a format string.
When I discovered this was possible, it was difficult to find out the exact properties the format string could have. Not all of the placeholders are intuitive: `%w %d/%b/%Y %R`. It's easier to work it out with context from snippets online but I wanted a complete list of the options I had available.
It turns out the C function called strftime is used, which means the syntax can easily be looked up on the internet or in the manpages.
This reminded me of PHP's date format function, but it's different and not just the lack of percent signs.