0

I have a function that returns me a date string using Zend_Date.

$date = new Zend_Date();
$date->setOptions(array('format_type' => 'php'));
$date->setTimestamp($timestamp);
return $date->toString($format);

When I set $format to 'l, d F Y' I expect something like:

Środa, 13 stycznia 2010 (correct polish string what means Wedneseday, 13 january 2010) and it works good.

But when I open this page in a browser with locale set to english it returns me date string in english instead of polish that I want to see.

What and where should I set to get always polish date regardless of browser settings ?

Corey Ballou
  • 42,389
  • 8
  • 62
  • 75
hsz
  • 148,279
  • 62
  • 259
  • 315

1 Answers1

5

Pass the 3rd parameter to toString():

$a = Zend_Date::now();
$a->setOptions(array('format_type' => 'php'));
$a->toString('l, d F Y', null, 'pl'); // wtorek, 12 stycznia 2010
Emil Ivanov
  • 37,300
  • 12
  • 75
  • 90