我的表格结构:
+------------+---------------+------+-----+-------------------+----------------+
| 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
函数。
我是一名优秀的程序员,十分优秀!