The Zend Framework Zend_Locale Component PRO

Using the Zend_Locale component we can represent different locales. Each locale is a combination of a language and a country. Usually we will set the default locale of our application during the execution of our bootstrap file.

Zend_Locale::setDefault('he_IL');

There are various possible ways for using the Zend_Locale. The following code sample creates new Zend_Locale objects for representing two different locales and printing out a specific date in according to each one of them.

$usLocale = new Zend_Locale('en_US');
$dateUs = new Zend_Date('12/02/2003', null, $usLocale);

$ilLocale = new Zend_Locale('he_IL');
$dateIl = new Zend_Date('12/02/2003', null, $ilLocale);

Zend_Debug::dump("in us ".$dateUs);	
Zend_Debug::dump("in il ".$dateIl);

The following video clip shows the execution of the last code sample.

Share:

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences