Date format in different languages

hi cboita,

its not a shopware problem.

$month = date('F');
echo $month;

_‚F‘ A full textual representation of a month, such as January or March -> January through_December

http://php.net/manual/en/function.date.php

You have to translate it by your own, like :

$lang = 'de';
$translate['de'] = array('Januar', 'Februar', 'März', ...);
$translate['en'] = array('January', 'February', 'March', ...);
$month = date('n');
echo $translate[$lang][$month-1];

you could do it with a plugin or try it with smarty.

smarty modifier: Modifiers | Smarty

example:

{$sArticle.displayDate|my_date_formate:'de'}

 

1 „Gefällt mir“