code/libraries/joomlatools/library/template/helper/date.php
public function format($config = array())
    {
        $translator = $this->getObject('translator');

        $config = new KObjectConfig($config);
        $config->append(array(
            'date'     => 'now',
            'timezone' => date_default_timezone_get(),
            'format'   => $translator->translate('DATE_FORMAT_LC1'),
            'default'  => ''
        ));

        $return = $config->default;

        if(!in_array($config->date, array('0000-00-00 00:00:00', '0000-00-00')))
        {
            try
            {
                $date = $this->getObject('lib:date', array('date' => $config->date, 'timezone' => 'UTC'));
                $date->setTimezone(new DateTimeZone($config->timezone));

                $return = $date->format($config->format);
            }
            catch(Exception $e) {}
        }

        return $return;
    }
public function format($config = array())
    {
        $translator = $this->getObject('translator');

        $config = new KObjectConfig($config);
        $config->append(array(
            'date'     => 'now',
            'timezone' => date_default_timezone_get(),
            'format'   => $translator->translate('DATE_FORMAT_LC1'),
            'default'  => ''
        ));

        $return = $config->default;

        if(!in_array($config->date, array('0000-00-00 00:00:00', '0000-00-00')))
        {
            try
            {
                $date = $this->getObject('lib:date', array('date' => $config->date, 'timezone' => 'UTC'));
                $date->setTimezone(new DateTimeZone($config->timezone));

                $return = $date->format($config->format);
            }
            catch(Exception $e) {}
        }

        return $return;
    }
public function format ( $ config = array ( ) ) { $ translator = $ this -> getObject ( 'translator' ) ; $ config = new KObjectConfig ( $ config ) ; $ config -> append ( array ( 'date' => 'now' , 'timezone' => date_default_timezone_get ( ) , 'format' => $ translator -> translate ( 'DATE_FORMAT_LC1' ) , 'default' => '' ) ) ; $ return = $ config -> default ; if ( ! in_array ( $ config -> date , array ( '0000-00-00 00:00:00' , '0000-00-00' ) ) ) { try { $ date = $ this -> getObject ( 'lib:date' , array ( 'date' => $ config -> date , 'timezone' => 'UTC' ) ) ; $ date -> setTimezone ( new DateTimeZone ( $ config -> timezone ) ) ; $ return = $ date -> format ( $ config -> format ) ; } catch ( Exception $ e ) { } } return $ return ; }
Returns formatted date according to current local and adds time offset.

@param  array  $config An optional array with configuration options.
@return string Formatted date.
Returns formatted date according to current local and adds time offset .