Returns abbreviated name of the current timezone according to DST setting.

@param bool $dst

@return string
325281
public function getAbbreviatedName($dst = false)
    {
        $name = $this->getName();

        foreach ($this->listAbbreviations() as $abbreviation => $zones) {
            foreach ($zones as $zone) {
                if ($zone['timezone_id'] === $name && $zone['dst'] == $dst) {
                    return $abbreviation;
                }
            }
        }

        return 'unknown';
    }
294436
function tzinfo($zone) {
		$ref=new DateTimeZone($zone);
		$loc=$ref->getLocation();
		$trn=$ref->getTransitions($now=time(),$now);
		$out=array(
			'offset'=>$ref->
				getOffset(new DateTime('now',new DateTimeZone('GMT')))/3600,
			'country'=>$loc['country_code'],
			'latitude'=>$loc['latitude'],
			'longitude'=>$loc['longitude'],
			'dst'=>$trn[0]['isdst']
		);
		unset($ref);
		return $out;
	}
1281296
public function getDay($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('j', $timestamp);
    }
799089
private function getTimezone()
    {
        if (!$this->timezone) {
            $this->timezone = $this->coreParametersHelper->getParameter(
                'default_timezone'
            );
        }

        return $this->timezone;
    }
64901
public static function getISO8601($timestamp=false) {
        if ( $timestamp === false ) {
            $dt = new \DateTime();
        } else {
            $format = 'Y-m-d H:i:s';
            $dt = \DateTime::createFromFormat($format, $timestamp);
        }

        // 2017-08-16T16:26:31-1000
        $iso8601 = $dt->format(\DateTime::ISO8601);

        // 2017-08-20T10:34:05.000Z
        $iso8601 = str_replace('-1000','.000Z',$iso8601);

        return $iso8601;
    }
1100084
public function getRelativeDateTime($timestamp, $ending = true)
    {
        if (! $timestamp) {
            return 'N/A';
        }
        
        if (! is_numeric($timestamp)) {
            $timestamp = (int) strtotime($timestamp);
        }
        
        if ($timestamp == '0') {
            return 'N/A';
        }
        
        $this->relative_config['suffix'] = true;
        if (! $ending) {
            $this->relative_config['suffix'] = false;
        }
        
        $relative = new RelativeTime($this->relative_config);
        return $relative->timeAgo($timestamp);
    }
161059
public function getTime($seconds) {

        $dtF = new \DateTime("@0");
        $dtT = new \DateTime("@$seconds");
        return $dtF->diff($dtT)->format('%h hours, %i minutes %s sec.');

    }
346324
public static function getTimezoneFromCode($sCode)
    {
        $aAbbreviations = \DateTimeZone::listAbbreviations();
        foreach ($aAbbreviations as $sTzCode => $aValues) {
            if (strtolower($sCode) == $sTzCode) {
                $aTimeZone = reset($aValues);
                return getFromArray('timezone_id', $aTimeZone, false);
            }
        }

        return false;
    }
907143
public function getFormattedDuration($seconds)
    {
        $duration = ceil($seconds) . ' seconds';

        if ($duration > 60) {
            $duration = round($duration / 60, 1) . ' minutes';
        } elseif ($duration > 3600) {
            $duration = round($duration / (60 * 60), 1) . ' hours';
        } elseif ($duration > (24 * 60 * 60)) {
            $duration = round($duration / (24 * 60 * 60), 1) . ' days';
        }

        return $duration;
    }
306758
public static function shortDate($timestamp = null)
    {
        $l = self::getLocale();
        $cYear = date('Y');
        $date = date('Y-m-d', $timestamp);
        if (date('Y-m-d') == $date) {
            return I18n::get('Today %1', self::formatTime($timestamp));
        } elseif (date('Y-m-d', strtotime('yesterday')) == $date) {
            return I18n::get('Yesterday %1', self::formatTime($timestamp));
        } elseif (date('Y-m-d', strtotime('tomorrow')) == $date) {
            return I18n::get('Tomorrow %1', self::formatTime($timestamp));
        } elseif ($cYear == date('Y', $timestamp)) {
            return self::date(I18n::get('F j'), $timestamp);
        } else {
            return self::date(I18n::get('F Y'), $timestamp);
        }
    }
968833
protected static function formatTime($time) {
        if ($time > 1000 && $time < 60000) {
            return sprintf('%02.2f', $time / 1000).'s';
        }

        if ($time > 60000) {
            return sprintf('%02.2f', $time / 60000).'m';
        }

        return sprintf('%02.2f', $time).'ms';
    }
403546
function formatTimeType( $fmt, $time = false )
    {
        if ( $time == false )
            $time = time();

        $text = date( eZLocale::transformToPHPFormat( $fmt, $this->TimePHPArray ), $time );
        return  str_replace( array( '%a', '%A' ),
                             array( $this->meridiemName( $time, false ),
                                    $this->meridiemName( $time, true ) ),
                             $text );
    }
1354184
public function getTimeZone() {
        $tzs = $this->user->getPropertyValues(GenerisRdf::PROPERTY_USER_TIMEZONE);
        $tz = empty($tzs) ? '' : (string)current($tzs);
        return empty($tz) ? TIME_ZONE : $tz;
    }
937394
def strtimezone ():
    
    if time.daylight:
        zone = time.altzone
    else:
        zone = time.timezone
    return "%+04d" % (-zone//SECONDS_PER_HOUR)
957407
def is_dst(zonename):
    
    tz = pytz.timezone(zonename)
    now = pytz.utc.localize(datetime.utcnow())
    return now.astimezone(tz).dst() != timedelta(0)
214920
def tzname(self, dt):
        
        if self.__is_daylight_time(dt):
            return time.tzname[1]
        else:
            return time.tzname[0]
745845
function get_day_shortname($date="") {
  	if ($date=="") {
  		$date = $this->mdate();
 		}
		$dt = \DateTime::createFromFormat($this->dateFormat, $date);
		return $dt->format('D');
 	}