如何创建 PHP 十六进制时间戳

Tar*_*rya 1 php hex timestamp

我必须将 php 中的时间戳转换为 php 中的十六进制时间戳。问题是,我无法找到方法。猜猜这将是一些简单的功能。有人可以帮我吗?

小智 5

您可以通过使用 time() 调用当前时间戳,然后使用 dexhex 函数将其转换为十六进制来创建十六进制纪元时间戳:

$hextime = dechex(time());
Run Code Online (Sandbox Code Playgroud)

http://php.net/manual/en/function.time.php

http://php.net/manual/en/function.dechex.php