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.


7 Responses to “HOWTO: Customise Thunderbird Date Format”  

  1. 1 What is Linux?

    Thank you! I was going mad with Thunderbird ignoring KDE’s date preference. Like you, I needed 24 hour time, the proper year-month-day order, and dashes instead of slashes.

  2. 2 Ivan

    Hi, I was dealing with this incorrect data format in Thunderbird as well. It was ‘hard set’ to an american format mm-dd-yyyy but I am using a dd-mm-yyyy format. I tried to apply a lot of solutions found on the internet but no luck. The only one working fine for me is here:

    http://ubuntuforums.org/showthread.php?t=595982

  3. 3 George

    Thanx!!!Nice work

  4. 4 wwwillem

    Good stuff!! But isn’t it weird? I would like to have my date/time in ISO standard “yyyy-mm-dd hh:mm:ss”.

    So I used the little shell script to extract all date/time formats for all locales, and surprise, surprise …. none of the locales has a “yyyy-mm-dd” date format. The closest one is “yy-mm-dd” (fr_CA), but you can’t get 4 digit years. Mmm, nobody can remember Y2K? :-)

  5. 5 Colin

    I had the same annoyance wwwillem. The only alternate solution I can think of is to create your own locale with your desired date format. Probably a bit OTT, but gets the job done ;-)

  6. 6 Atlasz

    wwwillem, use LC_TIME=en_DK as described here:
    http://kb.mozillazine.org/Date_display_format

    The solution with creating the init file works for me now :-)

  7. 7 wwwillem

    I know about en_DK, but it seems to be missing from Solaris. Will test on a Linux box to see if that’s the issue.

Speak Your Mind    cocomment icon