gpt4 book ai didi

php - 如何在时间格式之间进行转换?

转载 作者:行者123 更新时间:2023-11-29 03:52:03 25 4
gpt4 key购买 nike

我希望使用 PHPMySQL 时间戳 转换为以秒为单位的纪元时间,反之亦然。

最干净的方法是什么?

最佳答案

参见 strtotimedate PHP 手册中的函数。

$unixTimestamp = strtotime($mysqlDate);
$mysqlDate = date('Y-m-d h:i:s', $unixTimestamp);

关于php - 如何在时间格式之间进行转换?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/115428/

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