date/time localization
Permalink
I wonder if its possible to return local date/time formats (german in my case) with the getCollectionDatePublic() method.
I need them as example for the page-list block for news entries on a website.
So the returned date months and days should be in german language. (ex. "Juli" instead of "July")
I am quite new to PHP OOP, but if I am not wrong it should be possible to modifier the getCollectionDatePublic() function with "strftime()" and the general concrete5 localization?!
Maybe the calendar add-on would be "fixed" with this as well?
Maybe you guys can help me out...
cheers
André
I need them as example for the page-list block for news entries on a website.
So the returned date months and days should be in german language. (ex. "Juli" instead of "July")
I am quite new to PHP OOP, but if I am not wrong it should be possible to modifier the getCollectionDatePublic() function with "strftime()" and the general concrete5 localization?!
Maybe the calendar add-on would be "fixed" with this as well?
Maybe you guys can help me out...
cheers
André
Hi everybody,
I've seen this question in other threads as well. But no answer so far.
I'm struggling with the same issue. I need to display date/time of a rss-feed in dutch.
So some php added to a custom template for the rss-displayer block would be enough. Unfortunatly I'm a newby to php.
Can anyone give a hint?
Thanx in advance.
I've seen this question in other threads as well. But no answer so far.
I'm struggling with the same issue. I need to display date/time of a rss-feed in dutch.
So some php added to a custom template for the rss-displayer block would be enough. Unfortunatly I'm a newby to php.
Can anyone give a hint?
Thanx in advance.
For the date/time attribute I used the following method. Haven't had a look at the RSS but maybe its an idea?
<?php $timestamp = strtotime($c->getCollectionAttributeValue('opgeleverd')); $formattedDate = date('j F, Y',$timestamp); // Vertaald de naam van de maand naar Nederlands. $formattedDate = str_replace("January", "Januari", $formattedDate); $formattedDate = str_replace("February", "Februari", $formattedDate); $formattedDate = str_replace("March", "Maart", $formattedDate); $formattedDate = str_replace("April", "April", $formattedDate); $formattedDate = str_replace("May", "Mei", $formattedDate); $formattedDate = str_replace("June", "Juni", $formattedDate); $formattedDate = str_replace("July", "Juli", $formattedDate); $formattedDate = str_replace("August", "Augustus", $formattedDate); $formattedDate = str_replace("September", "September", $formattedDate); $formattedDate = str_replace("October", "Oktober", $formattedDate); $formattedDate = str_replace("November", "November", $formattedDate); $formattedDate = str_replace("December", "December", $formattedDate);
Viewing 15 lines of 24 lines. View entire code block.
Put this in your template to get the date in localized format:
See the strftime docs for more options:http://php.net/manual/en/function.strftime.php...
EDIT: Just realized that the parameter "U" was missing and added it.
See the strftime docs for more options:http://php.net/manual/en/function.strftime.php...
EDIT: Just realized that the parameter "U" was missing and added it.
Any ideas, or is there already a common solution for that?