Date display format

From MozillaZine Knowledge Base
Jump to navigationJump to search
This article applies to both Thunderbird and Seamonkey.

By default Thunderbird and Seamonkey display the time only (without the date) for messages with today's date. For messages older than this, they display both the date and time. You can change the information that is displayed by modifying preferences.

The date format and the time format are set in your computer's operating system. You can change these formats by configuring your computer's settings.

Changing the information displayed

To change the information displayed, modify these preferences. If you are using the configuration editor and the preference that you want to modify is missing, create it as an Integer preference:

Preference Applies to Default value
mail.ui.display.dateformat.today Messages with today's date 0
mail.ui.display.dateformat.thisweek Messages with a date in the past seven days 2
mail.ui.display.dateformat.default Older messages 2

These preferences can have the following values:

Value Meaning Example date and time
0 No date 10:23 AM
1 Your system's long* date format Friday, December 31 2003 10:23 AM
2 Your system's short* date format 12/31/1999 10:23 AM
3** Year and month, separated by a slash 1999/12 10:23 AM
4** Abbreviated day name Fri 10:23 AM

* Some operating systems have only one date format. On these systems, the values 1 and 2 produce the same result.
** Values 3 and 4 were not supported in Thunderbird version 53 (due to switching to ICU/CLDR) but got implemented again in version 54. They stopped working again in Thunderbird 83. Value 4 (day name) was restored in version 91.

To control the display format for the header pane and when printing:

Preference Applies to Default value
mailnews.display.original_date* Date format in print (preview) false
mailnews.display.date_senders_timezone* Date format in header pane false

* mailnews.display.original_date was removed in Thunderbird 90. mailnews.display.date_senders_timezone also applies to printing now.

Setting this former preference to true will also set the latter.

Configuring the date/time system settings on your computer

In addition to the settings shown above, the precise display formats for date/time can also be affected by the system settings for date/time on your computer. For instance, depending on your computer's system settings, the numerical display format for the date could be "31.12.1999", "1999/12/31", "12/31/1999", or something else.

In Windows XP, you can change the settings for date/time format by going to the Control Panel. See here for detailed instructions.

In Mac OS X, go to the "International" panel in System Preferences. The date format can be adjusted under the "Format" tab.

From version 90 the following preferences can be set on all platforms, especially to avoid the complicated configuration for Linux described below:

   intl.date_time.pattern_override.date_*
   intl.date_time.pattern_override.time_*
   intl.date_time.pattern_override.connector_short

Substitute * with any of short/medium/long/full. The short connector is used for all formats.

In Linux, these settings are based on your locale. If the environment variable "LANG" is set to "en_US", for example, Thunderbird will show the date in "MM/DD/YYYY" format. To override the locale only for showing dates, set the "LC_TIME" environment variable (for example, "LC_TIME=en_GB"). If you want the ISO 8601 date format (YYYY-MM-DD), use the "en_DK" locale.

Note: there is a bug in Thunderbird where LC_ALL overrides the setting of LC_TIME. If you have old applications which require LC_ALL to be set to "C", then you might find that merely setting LC_TIME is not enough to change the date format.

In order to set this value only for Thunderbird you can either use a separate script to invoke Thunderbird that contains the following lines:

 #!/bin/sh
 export LC_TIME=en_DK  # or whatever you want
 [ "$LC_ALL" != "$LC_TIME" ] && unset LC_ALL # only necessary if set to something different from LC_TIME
 exec <FullPathToYourOriginalThunderbirdCommand>/thunderbird "$@"

make this shell script executable and place it in a directory that is in your binary search path *before* the original Thunderbird command.

OR, if you are using thunderbird 2.0, you can create a special script that thunderbird will load on startup. This can either be created as a system change by creating this file in your thunderbird/init.d directory where thunderbird is installed, OR a personal change by creating an init.d directory in your .thunderbird directory in your home directory.

mkdir -p ~/.thunderbird/init.d

Create a file named S00Locale.sh in the init.d with the contents

export LC_TIME=en_DK

make sure it's set executable

chmod +x S00Locale.sh

If you get an error message saying that "LC_TIME is not an identifier", you need to declare it before exporting it. Change the script to read:

LC_TIME=en_DK
export LC_TIME

If you are on an system using the utf8 charset (like Kubuntu/Ubuntu) and get this errromessage:

(thunderbird-bin:4587): Gtk-WARNING **: Locale not supported by C library.
       Using the fallback 'C' locale.

you need to add .utf8 (or .UTF-8) to the LC_TIME export, like export LC_TIME=en_DK.utf8.

You could also see a list of all the available locales using the locale -a command:

$ locale -a
C
en_AU.utf8
en_BW.utf8

Printing

By default, Thunderbird uses the standard mail format for the "Date:" heading when printing a message. The printing tools extension can be used to set the date format to the same format that is used when displaying the message.

Seamonkey prints the "Date:" heading in the same format as in the envelope pane display.

The format used in headers/footers of the printed page is the same format and defaults to your system's short date definition. [1]

See also

External links