@param string   $fid
@param int|null $timestamp

@return static
421022
public static function create($fid, $timestamp = null)
  {
    /**
     * @var $payload MarkDatePayload
     */
    $payload = parent::create($fid);
    $payload->timestamp = $timestamp;
    return $payload;
  }
181990
public static function create($fid, $bool = null)
  {
    if(!is_bool($bool))
    {
      throw new \InvalidArgumentException('Not a valid boolean value');
    }
    return parent::create($fid, $bool);
  }
142723
private static function timestampToCounter($timestamp, $timeStep)
    {
        $timestamp = abs(intval($timestamp));
        $counter = intval(($timestamp * 1000) / ($timeStep * 1000));

        return $counter;
    }
980197
public function timeStamp($timestamp = null) 
     {
        $ts = $timestamp ?: $this->getAttribute("timeStamp");
        if (is_integer($ts) || $ts instanceof TimeWindow) {
            return new TimeWindow(["timeStamp" => $ts]);
        }

        return new TimeWindow();
    }
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;
   }
426863
public function setTimestamp($timestamp)
    {
        if (!$timestamp instanceof \DateTime) {
            $date = new \DateTime();
            $date->setTimestamp($timestamp);
        } else {
            $date = $timestamp;
        }
        $this->header['TIMESTAMP'] = $date->format('M d H:i:s');
        return $this;
    }
729947
public function setTimestamp($timestamp = null)
    {
        $this->timestamp = (string)($timestamp ?? $this->modified());

        return $this;
    }
834913
public function fill( $input, $parameters = null, $timestamp = true )
	{
		$fill_array = [];

		if ($parameters == null) {
			$parameters = $this->params;
		}

		if( $this->validate($input, $parameters) )
		{
			foreach( $parameters as $key => $value )
			{
				if( is_null( $input[$key] ) )
				{

					$fill_array[ $key ] = $value[ 'default' ];

				}
				else
				{

					if ($value['array'])
					{

						if ($value['id'])
						{

							$input_array = array ();

							foreach ($input[ $key ] as $array_value)
							{

								array_push ($input_array, $this->create_id ($array_value));

							}

							$fill_array[ $key ] = $input_array;

						}
						else
						{

							$fill_array[ $key ] = $input[ $key ];

						}

					}
					else
					{

						if ($value['id'])
						{

							$fill_array[ $key ] = $this->create_id($input[ $key ]);

						}
						else
						{

							$fill_array[ $key] = $input[ $key ];

						}

					}

				}

			}

			if ($timestamp) {
				return $this->add_data ($fill_array);
			} else {
				return $fill_array;
			}

		}

		return false;
	}
218009
public function updateTimestamps($timestamp = null)
    {
        if ($timestamp instanceof \DateTime) {
            $timestamp = $timestamp->getTimestamp();
        } elseif (is_string($timestamp)) {
            $timestamp = strtotime($timestamp);
        } elseif (!is_int($timestamp)) {
            $timestamp = strtotime('1984-12-24T00:00:00Z');
        }

        // detect manifest offset / end of stub
        if (!preg_match('{__HALT_COMPILER\(\);(?: +\?>)?\r?\n}', $this->contents, $match, PREG_OFFSET_CAPTURE)) {
            throw new \RuntimeException('Could not detect the stub\'s end in the phar');
        }

        // set starting position and skip past manifest length
        $pos = $match[0][1] + strlen($match[0][0]);
        $stubEnd = $pos + $this->readUint($pos, 4);
        $pos += 4;

        $numFiles = $this->readUint($pos, 4);
        $pos += 4;

        // skip API version (YOLO)
        $pos += 2;

        // skip PHAR flags
        $pos += 4;

        $aliasLength = $this->readUint($pos, 4);
        $pos += 4 + $aliasLength;

        $metadataLength = $this->readUint($pos, 4);
        $pos += 4 + $metadataLength;

        while ($pos < $stubEnd) {
            $filenameLength = $this->readUint($pos, 4);
            $pos += 4 + $filenameLength;

            // skip filesize
            $pos += 4;

            // update timestamp to a fixed value
            $this->contents = substr_replace($this->contents, pack('L', $timestamp), $pos, 4);

            // skip timestamp, compressed file size, crc32 checksum and file flags
            $pos += 4*4;

            $metadataLength = $this->readUint($pos, 4);
            $pos += 4 + $metadataLength;

            $numFiles--;
        }

        if ($numFiles !== 0) {
            throw new \LogicException('All files were not processed, something must have gone wrong');
        }
    }
457674
public static function fromTimestamp(int $timestamp, ?string $timezone = null): Time
    {
        $timezone = $timezone ?: date_default_timezone_get();
        assert(Validate::isTimezone($timezone), sprintf('Invalid timezone: %s', $timezone));

        $time = sprintf('%d', $timestamp);
        $dateTime = DateTimeImmutable::createFromFormat('U', $time, new DateTimeZone('UTC'));
        $dateTime = $dateTime->setTimezone(new DateTimeZone($timezone));
        $hour = (int) $dateTime->format('G');
        $minute = (int) $dateTime->format('i');
        $second = (int) $dateTime->format('s');

        return new static($hour, $minute, $second);
    }
957326
protected function _parseTimestamp($timestamp)
    {
        if (is_null($timestamp))
            return AbstractQuery::getCurrentTimestamp();

        if (!AbstractQuery::isValidTimestamp($timestamp)) {
            if ($sTime = strtotime($timestamp)) {
                $timestamp = date('YmdHis', $sTime);
            } else {
                throw oxNew(
                    ConsoleException::class,
                    'Invalid timestamp format, use YYYYMMDDhhmmss format'
                );
            }
        }

        return $timestamp;
    }
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);
    }
689551
public function fidToUserId($fid) {
        $value = Cache::redis()->hGet('fid_#_user_id', $this->host_name . '@' . $fid);
        Cache::release();
        return $value;
    }
254193
public static function create(float $timestamp = null): \DateTime
    {
        $date = static::format($timestamp);
        return new \DateTime($date);
    }
334361
public static function create($fid, $type = MessengerFailureType::HARD)
  {
    /** @var static $payload */
    $payload = parent::create($fid);
    $payload->type = $type;
    return $payload;
  }
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;
    }
951193
function setTimestamp(?int $timestamp = null) {
        $this->timestamp = (new \DateTime(($timestamp !== null ? '@'.$timestamp : 'now')))->format('c');
        return $this;
    }