Customising Thunderbird's date format on Unix and Linux.
Small Thunderbird Logo

I use Mozilla Thunderbird as my mail client at work on Solaris 10. One of the annoying things with Thunderbird is the fact that it relies on the current locale setting to format the date and times on emails. As a result changing the date format is a bit of a pain in the arse.

Normally, my locale is either set to C or en_GB and as a result, my dates are formatted either as "08/31/05 13:10:23" (%m/%d/%y %H:%M:%S) or "31/08/05 1:10pm" (%d/%m/%y %r). Now I'm a bit fussy and prefer my dates to be in the UK format, but my times in the American (C) 24 hour format.

Today, I finally got round to sorting it out... I ran the following oneliner to iterate through all the available installed locales and print off their date and time format:

$ for x in `locale -a`
do
echo "$x"
LC_ALL=$x locale -k d_fmt t_fmt
echo "==="
done > ~/tmp/datefmts.out
$

This printed out all the locales and the date and time formats used for each locale and bunged them into a file. A quick squiz through the file revealed just the formatting I want:

===
ca
d_fmt="%d/%m/%y"
t_fmt="%H:%M:%S"
===

So, now I start Thunderbird using "$ LC_ALL=ca /usr/local/bin/thunderbird &" and I get my desired format.