Trac Date formatting issues (uk - windows)

By default, it appears that Trac is using american date format (MM/dd/yyyy) for entry and display of dates.

This is very confusing for us (as a uk company) - so I've been searching for a way to switch the date format to the uk format (dd/MM/yyyy).

After much googling, it semed that the way to set the date format for trac, was to set the locale in the location tag within the apache httpd.conf that is being handled by mod_python.

PythonOption TracLocale [locale]

So I tried entering en_GB as the locale - and got this error:

PythonHandler trac.web.modpython_frontend: Error: unsupported locale setting

So after more googling, I found that on windows, I needed to use EN-GB rather than en_GB (see here).

So I made the change and restarted apache - the error was fixed - but Trac was still showing dates as MM/dd/yyyy!!!

As a temorary workarond, I have set the locale to i18n - which causes the dates to be displayed as dd.MM.yyyy - which at least is understandable - although it does mean we get an error if we attempt to input dates in the uk format.

Has anyone any idea how we can get Trac to display UK dates correctly?

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Andy Allan's Gravatar Try using:
PythonOption TracLocale "English_United Kingdom"
# Posted By Andy Allan | 14/08/07 22:45
Daniel Lancelot's Gravatar Thanks Andy - that did the trick :)

Thought you might know ;)
# Posted By Daniel Lancelot | 14/08/07 23:54
gaz's Gravatar That command makes my ubuntu server give http 500 errors to every request.
# Posted By gaz | 17/01/08 11:25
Andy Allan's Gravatar That command is for Windows, not Linux.
# Posted By Andy Allan | 17/01/08 12:58
Mark Lane's Gravatar In case it's of any help to anyone stumbling across this (like me)...

PythonOption TracLocale en_GB

worked perfectly for us on Centos 5
# Posted By Mark Lane | 27/03/09 15:51
Matt's Gravatar for *nix systems using mod_python, this should be:
PythonOption TracLocale "en_GB.UTF-8"
See here for more info: http://trac.edgewall.org/wiki/TracFaq#how-do-i-cha...
# Posted By Matt | 22/05/09 12:03
ForceMagic's Gravatar Hello,

I also had problems with those Date format "MM/DD/YYYY". But for me the must anoying problem is that the Mask in my ticket for field "Due to assign" and "Due to closed" are "DD/MM/YYYY" but that's not true. Do you know how to change that ? Thx for your time.
# Posted By ForceMagic | 22/06/09 03:37
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1, hosted by TalkWebSolutions.