WebFaction
Community site: login faq

For one of my trac apps (there are several on my server) I need to change the date display format to YYYY-MM-DD. Searching the docs, I find all sorts of suggestions on how to do this, but I'm too clueless on Apache to understand how to implement the suggestions.

In the Trac faq, I see:

You change the format by setting an appropriate 'locale' in the configuration of your webserver. You do this for Apache by adding

SetEnv LC_TIME "xx_YY"

That's great, seems like exactly what I want. But, I'm not sure where I add this setting. Is it in .htaccess? If so, where in the file system should the .htaccess file reside? Or do I add these lines somewhere else?

I'm learning Apache now, and I'm sure I'll figure this out before too long, but if anyone could help me out in the mean time it would be greatly appreciated!

asked 14 Jan '12, 07:28

rodj
313
accept rate: 0%


Hi,

You need to put this line in a .htaccess file, which needs to be located in the ~/webapps/<appname> directory (where <appname> stands for the name of your trac app).

permanent link

answered 14 Jan '12, 07:39

todork
1.2k5
accept rate: 34%

Thanks, that helped. I now know where to put the .htaccess! But I still can't figure out how to get YYYY-MM-DD. Searching the web, I see tons of people talking about this, and one suggestion is to use the locale en_DK. Looks like that is not a "real" locale, and that it is not supported here at Webfaction? Anyone know how to get YYYY-MM-DD?

(20 Jan '12, 19:02) rodj

You have to select the locale, the language code and the country code. that will set the correct time/date stamps.

(20 Jan '12, 19:36) johns

I tried "en_DK", which is the one I want, and I got a trac error:

Trac detected an internal error: ValueError: unknown locale: en_DK

That is what led me to (mistakenly) believe that locale en_DK was not supported by Webfaction. I see that it is indeed listed by the command "locale -a".

Anyway, switching to using

SetEnv LC_TIME "en_DK.UTF_8"

does exactly what I want.

(21 Jan '12, 17:28) rodj
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×27
×26

question asked: 14 Jan '12, 07:28

question was seen: 4,049 times

last updated: 21 Jan '12, 17:30

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM