More information about this topic
Reset database
Select your language: English  Italian 
Date and time
  • Current language: en_us
  • Date & time short: 3/21/18 2:19:36 PM
  • Date medium: Mar 21, 2018
  • Time medium: 2:19:36 PM
  • Date short format: M/d/yy
  • Time medium format: h:mm:ss a
  • Parsed date and time: June 4, 2010
  • Date & time custom format: 03/21/2018 14:19:36


<li>Current language: <?php echo Yii::app()->getLanguage(); ?></li>
<li>Date &amp; time short: <?php echo Yii::app()->dateFormatter->formatDateTime(time(), 'short'); ?></li>
<li>Date medium: <?php echo Yii::app()->dateFormatter->formatDateTime(time(), 'medium', false); ?></li>
<li>Time medium: <?php echo Yii::app()->dateFormatter->formatDateTime(time(), false, 'medium'); ?></li>
<li>Date short format: <?php echo Yii::app()->locale->getDateFormat('short'); ?></li>
<li>Time medium format: <?php echo Yii::app()->locale->getTimeFormat('medium'); ?></li>
<li>Parsed date and time: <?php echo Yii::app()->dateFormatter->format(Yii::app()->locale->getDateFormat('long'),
				CDateTimeParser::parse('04/06/2010', 'dd/MM/yyyy')); ?></li>
<li>Date &amp; time custom format: <?php echo Yii::app()->dateFormatter->formatDateTime(time(), 'small', 'small'); ?></li>


 * Extends Locale data for 'en_US'.
 * In this file you can put custom locale settings that will be
 * merged with the ones provided by the framework
 * ( that are stored in <framework_dir>/i18n/data/ )

return CMap::mergeArray(
		'dateFormats' => array(
			'small'=>'MM/dd/yyyy',          // format used for input
			'calendar_small'=>'mm/dd/yy',   // format used for input with calendar widget
		'timeFormats' => array(
			'small'=>'HH:mm:ss',          // format used for input

Fork me on GitHub