zend-framework how to Localize Zend_Date

848 Views Asked by At

how to localize the Zend_Date

when i wrote

Zend_Debug::dump(Zend_Locale::getTranslationList('type', 'en_US'));

i got long array some of its elements

  .
  .
  ["hebrew"] => string(15) "Hebrew Calendar"
  ["indian"] => string(24) "Indian National Calendar"
  ["islamic"] => string(16) "Islamic Calendar"
  ["islamic-civil"] => string(22) "Islamic-Civil Calendar"
  ["japanese"] => string(17) "Japanese Calendar"
  .
  .

so i think Islamic Calendar , Hebrew Calendar is supported how to reach this features?

also it is commented in this page http://framework.zend.com/issues/browse/ZF-4291

1

There are 1 best solutions below

6
On

Why you don't have a look at the documentation, that's always the first thing you should do: Working with Dates and Times.

So with Zend_Locale_Format you can normalize and convert date and time for different locale.

E.g. you can normalize a data by locale like this:

  $locale = new Zend_Locale('de_AT');

  $date = Zend_Locale_Format::getDate('13.04.2005 22:14:55',
                                       array('date_format' =>
                                           Zend_Locale_Format::STANDARD,
                                       'locale' => $locale)   
  );

Hope that helps ;) . So this is the answer I got from him: you should have a look at WebCal.