gpt4 book ai didi

php - 像在 PHP 中一样在 Python 中获取格式化的日期时间

转载 作者:行者123 更新时间:2023-11-28 19:46:07 25 4
gpt4 key购买 nike

如何在 Python 中以与在 PHP 中相同的方式获取格式化日期时间日期('M d Y', $timestamp);?

最佳答案

>>> import time
>>> timestamp = 1284375159
>>> time.strftime("%m %d %Y",time.localtime(timestamp))
'09 13 2010'

关于php - 像在 PHP 中一样在 Python 中获取格式化的日期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3700118/

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