gpt4 book ai didi

php - 在 PHP 中格式化 time()

转载 作者:行者123 更新时间:2023-12-02 07:34:53 25 4
gpt4 key购买 nike

我正在使用一个数据库,在使用 time()
保存后,我在表中有时间有没有办法将其格式化为人类可读的方式(日期和时间)?

谢谢

最佳答案

是的,你可以使用date的功能。

echo date("F j, Y, g:i a", $timestamp);

输出将采用以下格式:

// March 10, 2001, 5:16 pm

关于php - 在 PHP 中格式化 time(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17753651/

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