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.
Twitter 的 API 以这种格式踢出日期:
Thu, 18 Oct 2012 09:37:01 +0000
对于我的数据库,是否可以使用 PHP 将其转换为日期时间格式?例如
2012-10-18 09:37:01
date( 'Y-m-d H:i:s', strtotime("Thu, 18 Oct 2012 09:37:01 +0000") );
使用格式中的日期时间对象
$date = DateTime::createFromFormat('D, j M Y H:i:s +0000', 'Thu, 18 Oct 2012 09:37:01 +0000'); echo $date->format('Y-m-d H:i:s');