Converts a timestamp extracted from a UUID to a unix timestamp
@param mixed $timestamp - an integer, string or a Moontoast\Bignumber object
@return string
519882
public function convertTime($timestamp)
    {
        $ts = new BigNumber($timestamp, 20);
        $ts->subtract('122192928000000000');
        $ts->divide('10000000.0');
        $ts->round();

        return $ts->getValue();
    }
59262
public function dayname($timestamp = 0)
    {
        $day = (int) date('w', $timestamp);

        return $this->translator->_($this->day[$day]);
    }
345754
protected function toDateTime($timestamp)
    {
        if (is_numeric($timestamp)) {
            // Unix timestamp.
            $result = new DateTime();
            $result->setTimestamp($timestamp);
        } else {
            // Formatted timestamp, e.g. yyyy-mm-dd hh:mm:ss.
            $result = DateTime::createFromFormat(static::$timestampFormat, $timestamp);
        }
        return $result;
    }
418793
private function formatTimestampFromApi(array $timestamp)
    {
        $timestamp += [
            'seconds' => 0,
            'nanos' => 0
        ];

        $dt = $this->createDateTimeFromSeconds($timestamp['seconds']);

        return $this->formatTimeAsString($dt, $timestamp['nanos']);
    }
1219750
public function getMinute($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('i', $timestamp);
    }
936232
public function setTimestamp($timestamp)
    {
        $this->timestamp = is_numeric($timestamp) ? $timestamp : strtotime($timestamp);

        return $this;
    }
708199
public static function createFromDOSTimestamp($timestamp, $timezone = null)
    {
        $year          = (($timestamp >> 25) & 0x7f) + 1980;
        $mon           = ($timestamp >> 21) & 0x0f;
        $mday          = ($timestamp >> 16) & 0x1f;
        $hours         = ($timestamp >> 11) & 0x1f;
        $minutes       = ($timestamp >> 5) & 0x3f;
        $seconds       = 2 * ($timestamp & 0x1f);
        $unixTimestamp = mktime($hours, $minutes, $seconds, $mon, $mday, $year);

        return static::createFromTimestamp($unixTimestamp, $timezone);
    }
609621
public static function isTimestamp($tstamp)
    {
        return ((string)(int)$tstamp === $tstamp)
        && ($tstamp <= PHP_INT_MAX)
        && ($tstamp >= ~PHP_INT_MAX);
    }
906490
private function _formateMaxLifeTimestamp ($timestamp = 0) {
		$result = [];
		if ($timestamp >= 31557600) {
			$localVal = floor($timestamp / 31557600);
			$result[] = $localVal . ' year' . (($localVal > 1) ? 's' : '');
			if ($localVal > 1) return 'more than ' . $result[0];
			$timestamp = $timestamp - (floor($timestamp / 31557600) * 31557600);
		}
		if ($timestamp >= 2592000) {
			$localVal = floor($timestamp / 2592000);
			$result[] = $localVal . ' month' . (($localVal > 1) ? 's' : '');
			if (count($result) == 1 && $localVal > 1) return 'more than ' . $result[0];
			$timestamp = $timestamp - (floor($timestamp / 2592000) * 2592000);
		}
		if ($timestamp >= 86400) {
			$localVal = floor($timestamp / 86400);
			$result[] = $localVal . ' day' . (($localVal > 1) ? 's' : '');
			if (count($result) == 1 && $localVal > 1) return 'more than ' . $result[0];
			$timestamp = $timestamp - (floor($timestamp / 86400) * 86400);
		}
		if ($timestamp >= 3600) {
			$localVal = floor($timestamp / 3600);
			$result[] = $localVal . ' hour' . (($localVal > 1) ? 's' : '');
			$timestamp = $timestamp - (floor($timestamp / 3600) * 3600);
		}
		if ($timestamp >= 60) {
			$localVal = floor($timestamp / 60);
			$result[] = $localVal . ' minute' . (($localVal > 1) ? 's' : '');
			$timestamp = $timestamp - (floor($timestamp / 60) * 60);
		}
		if ($timestamp > 0) {
			$localVal = floor($timestamp);
			if ($localVal > 1) $result[] = $localVal . ' seconds';
		}
		return implode(', ', $result);
	}
585229
public function setTimestamp($timestamp = null)
    {
        $this->timestamp = $timestamp;
        if ($timestamp === null) {
            $this->timestamp = new Timestamp();
        }
        return $this;
    }
973003
public function getHour($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('G', $timestamp);
    }
1348869
protected function sign($timestamp = null) {
		if (is_null($timestamp)) $timestamp = date('c');

		$input = sha1(print_r($this->auth, true));
		$hash = $this->hash($input, $timestamp, $this->env['security_iteration'], $this->env['security_salt']);

		return $hash;
	}
797915
public static function isTimestamp($timestamp)
    {
        if (!$timestamp || !is_numeric($timestamp) || 10 !== \strlen($timestamp)) {
            return false;
        }

        return date('Ymd', $timestamp) ? true : false;
    }
875901
public static function isoDate($timestamp = null)
    {
        $tz = date_default_timezone_get();
        date_default_timezone_set('UTC');

        if (is_null($timestamp)) {
            $timestamp = time();
        }

        $returnValue = str_replace(
            '+00:00', '.0000000Z', date('c', $timestamp)
        );
        date_default_timezone_set($tz);

        return $returnValue;
    }
751370
public final function last(int $timeStamp = null): string
   {
       if ($timeStamp) {
           $this->lastModification = gmdate(
               "D, d M Y H:i:s",
               $timeStamp) . " GMT";
       }
       return $this->lastModification;
   }
333160
public function setTimestamp($timestamp)
    {
        if (self::$_immutable) {
            self::$_immutable = false;
            $newDate = clone $this;
            $newDate->setTimestamp($timestamp);
            self::$_immutable = true;

            return $newDate;
        } else {
            return parent::setTimestamp($timestamp);
        }
    }
447204
public static function timestamp($timestamp = null)
    {
        if (!self::isDebug()) {
            return false;
        }

        $date = date(DATE_RFC822, $timestamp);
        return self::i()->dump($date, $timestamp . ' sec = ');
    }