Search code examples
phpzend-frameworkdatetimezend-date

Zend_Date returning strange format online - works fine on my localhost


I have the following code to format dates:

$date = new Zend_Date();
$date->set(strtotime($some_date);
echo ($date->get(Zend_Date::DATE_FULL));

it wokrs fine on my localhost outputting the date as I need it to be outputted. However on my online server the dates are outputted in a weird numerical way.

i.e the numeric value fo the Day and month are shown instead of the text - it reads as 2, 2010 7 12 instead of Monday 12th July 2010

How do I fix this!


Solution

  • Sounds to me like it's using a different locale on the server. Try setting a locale and see what happens then: http://framework.zend.com/manual/en/zend.locale.introduction.html