gpt4 book ai didi

php - 这是什么时间格式以及如何在 php 中将其转换为 unix 时间?

转载 作者:太空宇宙 更新时间:2023-11-03 15:53:13 25 4
gpt4 key购买 nike

2015-07-01T23:06:30Z 我从 paypal api 得到了这个。在T和Z代表什么之前,我从未见过这种格式。我如何在 php 中将其转换为 unix 时间?

最佳答案

这是 ISO8601 格式的日期/时间。 T 是标记时间字段开始的分隔符,Z(通常称为“Zulu”)是 GMT 或 UTC 的常用简写。

PHP 直接支持它,因此您只需使用 strtotime()

echo strtotime("2015-07-01T23:06:30Z"); // 1435791990

ISO8601 Reference

关于php - 这是什么时间格式以及如何在 php 中将其转换为 unix 时间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31175551/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com