gpt4 book ai didi

mysql - 为什么我从表中获取时间戳格式后会发生变化?

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

我的表格结构:

+------------+---------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+---------------+------+-----+-------------------+----------------+
| f_id | bigint(20) | NO | PRI | NULL | auto_increment |
| f_uid | bigint(20) | NO | | NULL | |
| f_phone | char(32) | YES | | NULL | |
| f_username | char(64) | YES | | NULL | |
| f_amount | decimal(16,8) | NO | | NULL | |
| f_unspent | decimal(16,8) | NO | | 0.00000000 | |
| f_number | int(11) | NO | | NULL | |
| f_left | int(11) | NO | | 0 | |
| f_coin | int(11) | NO | | 0 | |
| f_message | varchar(128) | YES | | NULL | |
| f_accurate | int(11) | NO | | 0 | |
| f_type | int(11) | NO | | 0 | |
| f_status | int(11) | NO | | 0 | |
| f_created | timestamp | NO | | CURRENT_TIMESTAMP | |
| f_key | char(64) | YES | | NULL | |
+------------+---------------+------+-----+-------------------+----------------+

我的示例数据:

+------+--------+---------------------+
| f_id | f_uid | f_created |
+------+--------+---------------------+
| 1 | 123456 | 2018-08-14 10:33:52 |
+------+--------+---------------------+

然后,当我通过 Python API 获取 f_created 值时,我有不同的日期格式:

"Tue, 14 Aug 2018 10:33:52 GMT"

为什么会发生?有什么建议吗?

最佳答案

当您在 python 中检索它时,您会得到一个 python datetime 对象。如何打印取决于 datetime.strptime/strftime 函数。

关于mysql - 为什么我从表中获取时间戳格式后会发生变化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51877093/

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