Returns the next full hour

@param int $timestamp
@return int
489866
protected function hourCeil($timestamp)
    {
        return mktime(date('H', $timestamp) + 1, 0, 0, date('n', $timestamp), date('j', $timestamp), date('Y', $timestamp));
    }
771243
public function fromRedisTimestamp($timestamp) : DateTime
    {
        $date = DateTime::createFromFormat('U', $timestamp);
        $date->setTimezone(new DateTimeZone(date_default_timezone_get()));

        return $date;
    }
908204
public function fromMemcachedTimestamp($timestamp) : DateTime
    {
        $date = DateTime::createFromFormat('U', $timestamp);
        $date->setTimezone(new DateTimeZone(date_default_timezone_get()));

        return $date;
    }
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);
        }
    }
301862
private function getNextJobAtTimestamp($timestamp): Job
    {
        $key = sprintf('%s:%s', self::AT_QUEUE_NAME, $timestamp);

        $item = json_decode($this->client->lpop($key), true);

        $this->cleanupTimestamp($timestamp);

        return new Job($item['class'], $item['queue'], $item['args'], $item['id']);
    }
447204
public static function timestamp($timestamp = null)
    {
        if (!self::isDebug()) {
            return false;
        }

        $date = date(DATE_RFC822, $timestamp);
        return self::i()->dump($date, $timestamp . ' sec = ');
    }
774053
protected function timestampHasExpired(int $timestamp): bool
    {
        $date = Carbon::createFromTimestamp($timestamp, 'UTC');
        $start = Carbon::now('UTC')->subSeconds($this->timestampExpires);
        $end = Carbon::now('UTC');

        return !$date->between($start, $end);
    }
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;
   }
534163
public static function getFormatedDate($timestamp)
    {
        return MTimestampHelper::getDay($timestamp) . "." . MTimestampHelper::getMonth($timestamp) . "." . MTimestampHelper::getYear($timestamp);
    }
303495
public static function format($timestamp): string
    {
        $str = '';
        $timestamp = round($timestamp * 1000);
        foreach (self::TIME as $unit => $value) {
            if ($timestamp >= $value) {
                $time = floor($timestamp / $value * 100.0 / 100.0);

                if ($time > 0) {
                    $str .= $time.' '.$unit.($time === 1.0 ? '' : 's').' ';
                }
                $timestamp -= ($time * $value);
            }
        }

        if ($timestamp > 0) {
            $str .= $timestamp.' ms';
        }

        return trim($str);
    }
927799
public static function fromMilliseconds($timestamp = null)
    {
        if (! $timestamp) {
            return null;
        }

        return Carbon::createFromTimestamp(self::toSeconds($timestamp));
    }
840497
public static function nextItemForTimestamp($timestamp)
    {
        $timestamp = self::getTimestamp($timestamp);
        $key = self::QUEUE_NAME . ':' . $timestamp;

        $item = json_decode(\Resque::redis()->lpop($key), true);

        self::cleanupTimestamp($key, $timestamp);

        return $item;
    }
1040255
public function getSecond($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return (int) date('s', $timestamp);
    }
31909
public function isVisitTime($timestamp = null)
    {
        $timestamp = is_int($timestamp) ? $timestamp : time();
        foreach ($this->times as $time) {
            if ($this->isBetween($timestamp, $time['from'], $time['to'], 'Hi')) {
                return true;
            }
        }
        return empty($this->times);
    }
1235396
public static function distance($timestamp)
    {
        $second = $timestamp - time();
        if ($second > 0) {
            $day = floor($second / (3600 * 24));
            $second = $second % (3600 * 24);//除去整天之后剩余的时间
            $hour = floor($second / 3600);
            $second = $second % 3600;//除去整小时之后剩余的时间
            $minute = floor($second / 60);
            $second = $second % 60;//除去整分钟之后剩余的时间

            $distance = [
                'day' => $day,
                'hour' => $hour,
                'minute' => $minute,
            ];
            return $distance;
        }
    }
561910
public function getGMTMidnightTstamp(int $tstamp)
    {
        $date = new \DateTime(date('Y-m-d', $tstamp));
        $date->setTimezone(new \DateTimeZone('GMT'));
        $date->setTime(0, 0, 0);

        return $date->getTimestamp();
    }
724399
public static function fromTimestampWithMicroseconds(int $timestamp) : self
    {
        $seconds      = (int)($timestamp / 10 ** 6);
        $microseconds = $timestamp - ($seconds * 10 ** 6);

        // Ensure microseconds are right-padded with zeros because values like 012345 will be 12345 when expressed
        // as an integer, and the concatenation below will therefore shift digits left by one place.
        $microseconds = str_pad($microseconds, 6, '0', STR_PAD_LEFT);
        
        return static::fromFormat('U.u', $seconds . '.' . $microseconds);
    }