Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将如何转换此用户输入:
2013 年 1 月 22 日下午 2:33
使用 PHP 转换成正常的 SQL 时间戳格式?
2013-01-22 14:33:00
使用DateTime的createFromFormat
DateTime
createFromFormat
$datetime = DateTime::createFromFormat('m/d/Y g:i a', '01/22/2013 2:33 pm'); echo $datetime->format('Y-m-d H:i:s');