Localisation and timezones

17 views
Skip to first unread message

Tom Evans

unread,
Oct 10, 2012, 6:40:30 AM10/10/12
to django...@googlegroups.com
Hi all

If you enable USE_L10N=True, then datetime, date and time formats are
all taken from the definition for the current locale. However, none of
these formats seem to include the timezone of a non-naive datetime
field, which I can add by disabling USE_L10N and defining an
appropriate DATETIME_FORMAT.

Is there any way around this? I can have sane datetime formats, but
only if I disable all localisation?

Cheers

Tom

Tom Evans

unread,
Oct 10, 2012, 6:54:29 AM10/10/12
to django...@googlegroups.com
I should have just kept reading. I can create a custom
formats/<locale>/formats.py which defines the updated format(s) I want
for that locale.

Cheers

Tom

koenb

unread,
Oct 10, 2012, 6:59:04 AM10/10/12
to django...@googlegroups.com, teva...@googlemail.com
Tom,

I  think you can create a custom format file for that (see [1] ).

Koen

[1] : https://docs.djangoproject.com/en/1.4/topics/i18n/formatting/#creating-custom-format-files

Op woensdag 10 oktober 2012 12:40:52 UTC+2 schreef Tom Evans het volgende:
Reply all
Reply to author
Forward
0 new messages