Date display format: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
Line 81: Line 81:
==External links==
==External links==
* [https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&id=901 ConfigDate extension for Thunderbird]: allows you to configure the date display format without needing to manually edit the user.js file.
* [https://addons.mozilla.org/extensions/moreinfo.php?application=thunderbird&id=901 ConfigDate extension for Thunderbird]: allows you to configure the date display format without needing to manually edit the user.js file.
* [http://xsidebar.mozdev.org/modifiedmisc.html#configdate ConfigDate extension for SeaMonkey]: allows you to configure the date display format without needing to manually edit the user.js file.
* [http://myy.helia.fi/~karte/international_iso-8601_date_on_thunderbird.html International ISO-8601 Date Format on Thunderbird] for the problem and fix for UTF-8 systems
* [http://myy.helia.fi/~karte/international_iso-8601_date_on_thunderbird.html International ISO-8601 Date Format on Thunderbird] for the problem and fix for UTF-8 systems



Revision as of 03:58, 22 January 2007

This article applies to both Thunderbird and the Mozilla Suite.

Changing the display format for today's date

By default the Mozilla Suite and Thunderbird display the time only (without the date) for messages less than one day old.  For messages older than this, both the date and time will be displayed.  To change the display format for today's date, exit the Mozilla Suite or Thunderbird and insert the following line into the "user.js" file, replacing [value] with one of the values shown in the table below:

user_pref("mail.ui.display.dateformat.today", [value]);
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.

Example:

user_pref("mail.ui.display.dateformat.today", 2);

With the above line inserted into user.js, messages received or sent during the current day will be displayed with both the date and time. The date will be in your operating system's current short date format (which is typically a numeric format).

You can also edit the configuration using about:config or the Thunderbird Config Editor.

Changing the display format for other dates

You can similarly change the display format for "this week" (the past seven days excluding today) or the default date format (all dates excluding the past seven days). To do so, use one of the values shown in the table above and insert the appropriate line of code into the "user.js" file, as shown below.

For "this week":

user_pref("mail.ui.display.dateformat.thisweek", [value]); 

For the default date:

user_pref("mail.ui.display.dateformat.default", [value]);

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 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. In order to set this value only for Thunderbird, use a seperate script to invoke thunderbird that contains the following lines:

 #!/bin/sh
 export LC_TIME=en_GB # or whatever you want
 <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.

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

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

External links