哪个时间邮票格式是1651928421543667000
我使用的是API,它返回时间戳为1651928421543667000,我找不到
strtotime()
datetime()
strftime()
在PHP中使用的支持格式吗?谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我使用的是API,它返回时间戳为1651928421543667000,我找不到
strtotime()
datetime()
strftime()
在PHP中使用的支持格式吗?谢谢!
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
这是纳米秒的时间戳。开发人员需要
ns
精度,用于使用I/O,RAM,无线电信号等的一些低级任务。您可以使用诸如echo System之类的命令('日期 +%s%n');
。您还可以通过 ns 转换为MS
或s
- “ rel =“ nofollow noreferrer”>公制系统的基础知识其中nano
指示10^-9。It's a timestamp in nanoseconds. Devs need
ns
precision for some low-level tasks with I/O, RAM, radio signals and etc. You can get the same value in PHP by using a command such asecho system('date +%s%N');
. You can also convertns
intoms
ors
by using basics of metric system wherenano
indicates 10^-9.因此,输出是Unix-Timestamp格式。如果要将其转换为常规DateTime格式,请使用以下代码。但是,如@mardubbles所指出的那样,您必须将其首先转换为秒。
So the output is a UNIX-Timestamp format. If you want to convert it to a regular datetime format, use the following code. However, you have to convert it to seconds first by dividing the time by 10^9 as @mardubbles pointed out.