More information about this topic
Reset database  | 
Select your language: English  Italian  Thai 
Date and time
  • Current language: en_us
  • Date & time short: 1/18/21 10:04:25 PM
  • Date medium: Jan 18, 2021
  • Time medium: 10:04:25 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: 01/18/2021 22:04:25


<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