From: Reini U. <ru...@x-...> - 2001-03-14 12:15:43
|
> Thomas Kalka schrieb: > does anybody have already some code to display a localised version of > the date output (for example in german). which date output? there are multiple. in the template, in the transformation. date() is not localised, use strftime() instead. but strftime() has a different template syntax. edit index.php also then. I use this for converting a mysql isodate to a localized date string: ---- setlocale("LC_TIME", "german"); function fmt_isodate ($isodate) { return strftime ("%a., %d. %b %Y", strtotime($isodate));} ---- you'll probably have to edit just this code from lib/stdlib.php: (this is from my extended version) replace date($datetimeformat with something like strftime("%x %X" %x for date, %X for time ---- if (!empty($hash['lastmodified'])) { _iftoken('LASTMODIFIED', true, $page); _dotoken('LASTMODIFIED', date($datetimeformat, $hash['lastmodified']), $page); } elseif ($template == 'EDITPAGE') { // new page _iftoken('LASTMODIFIED', true, $page); _dotoken('LASTMODIFIED', date($datetimeformat, time()), $page); } else { // dynamic MagicPage: no edit _iftoken('LASTMODIFIED', false, $page); } ---- insert the setlocale somewhere before (best in index.php) see http://php.net/strftime > Or is this already implemented in > the current release ? (I'm using a hacked version 1.19) no -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |