Exemplo n.º 1
0
 /**
  * Get formated date in locale, GMT0 or custom localization.
  *
  * @param string $date   date in format to work with PHP strftime (Joomla 1.5.x) or date (Joomla 1.6.x) method.
  * @param string $format string format for strftime/date (see above).
  * @param mixed  $offset time zone offset. 0/null/value - GMT0/offset from Joomla global config/custom offset
  * @return string formated date
  */
 static function date($date, $format, $offset = null)
 {
     if ($offset === 0) {
         $offset = 'GMT0';
     }
     if ($offset === null) {
         $mainframe =& JFactory::getApplication();
         /* @var $mainframe JApplication */
         $offset = $mainframe->getCfg('offset');
     }
     switch ($date = AHtml::cleanDate($date)) {
         case '':
             return '';
         default:
             return JHtml::date($date, $format, $offset);
     }
 }