【发布时间】:2013-09-30 05:44:24
【问题描述】:
我在 mysql 中有以下称为“StartTime”字段的 DateTime 字段为“1899-12-30 12:17:52”
我正在尝试将其转换为使用 php 的用户在屏幕上显示的时间
date('h:i:s A',strtotime($row_get_student_times['StartTime']))
但无论出于何种原因,无论何时,它总是返回下午 4:00。任何线索为什么会发生这种情况?
【问题讨论】:
-
1899年份太旧,strtotime 无法转换,需要使用DateTimephp.net/manual/en/class.datetime.php