How to get Danish Date Format?

541 views
Skip to first unread message

Kasper Worm Andersson

unread,
Mar 6, 2008, 4:04:12 AM3/6/08
to habari-users
Hi,

I found this line "Format::apply( 'nice_date', 'post_pubdate_out', 'F
j, Y' );" in the theme.php file. I want to remake the format to Danish
standards with Danish day names. Anyone figured out, how to do it?

Massimiliano

unread,
Mar 7, 2008, 5:47:23 AM3/7/08
to habari-users
Hi Kasper.
F is the month, j is the day without the leading zero, Y is the four-
digit year (March 07, 2008). You have to substitute 'F j, Y' with the
letters listed in http://www.php.net/manual/en/function.date.php that
match the Danish format. For instance, l (lowercase L) is the day of
the week. Words are in English, you need localisation to translate
them to Danish, but localization is not implemented yet.
Massimiliano

On 6 Mar, 10:04, Kasper Worm Andersson <k.wormanders...@gmail.com>
wrote:

Matthias Bauer

unread,
Mar 7, 2008, 5:57:08 AM3/7/08
to habari...@googlegroups.com
Massimiliano wrote:

> F is the month, j is the day without the leading zero, Y is the four-
> digit year (March 07, 2008). You have to substitute 'F j, Y' with the
> letters listed in http://www.php.net/manual/en/function.date.php that
> match the Danish format. For instance, l (lowercase L) is the day of
> the week. Words are in English, you need localisation to translate
> them to Danish, but localization is not implemented yet.

As a quick workaround, you can call setlocale(LC_TIME, 'dk_DK'); in your
theme's index.php or in your config.php. That should give you localized
month names, provided the danish locale is insalled on your system.

-Matt

Kasper Worm Andersson

unread,
Mar 7, 2008, 5:47:19 PM3/7/08
to habari-users
Hi Matt, how does the line looks and where should i put it in the
index.php (is that header.php, cause my k2 doesn't have a index.php?)

Thanks!

Kasper Worm Andersson

unread,
Mar 7, 2008, 6:23:08 PM3/7/08
to habari-users
I got it, it's fixed!

Thanks for your help.

On 7 Mar., 23:47, Kasper Worm Andersson <k.wormanders...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages