Hi all,

Before I add a enhancement ticket in trac I would like to know what
you people do in this situation:
I have a database datetime '2007-09-13 13:24:12' en I would nicely
transform that on a webpage to: 'September 13th 13:24h'
I used the Time Helper like this: $time->format('F dth H:i',
$db_datetime);

But I looed in the api (http://api.cakephp.org/1.2/time_8php-
source.html#l00417) and I see that the Time helper makes use of the
PHP date() function. Very well, but I want to show it in the locale of
the loggedin user (english, dutch, spanish, etc) and the only way is
to use PHP strftime() function.

Should this be added to the time helper to make use of both? (date and
strftime)?

function format($format = 'd-m-Y', $date) {
   return date($format, $this->fromString($date));
}

function formatLocal($format = '%d-%m-%Y', $date) {
   return strftime($format, $this->fromString($date));
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to