apache日志中的日期格式如何转换成mysql中的datetime
需要添加apache log记录中的日期到数据库中,数据库字段类型为datetime,如何转换下面的字符串到日期格式?
15/Apr/2012:23:54:05 -0700
转换成不带时区的datetime格式,时区转换成U来4源gaodaimacom搞#代%码*网搞代gaodaima码
TC时间。
——解决方案——————–
- PHP code
echo date('Y-m-d H:i:s', strtotime('15/Apr/2012:23:54:05 -0700')); //2012-04-16 02:54:05