您好,欢迎访问一九零五行业门户网

04 April 2014

将字符串
04 april 2014 - 09:00 am
转化成时间戳
strtotime不管用啊
求助~
回复讨论(解决方案) echo strtotime('04 april 2014 09:00 am');
怎么可能呢?你是怎么写的?
echo strtotime('04 april 2014 09:00 am');
得到结果:1396602000 
echo strtotime('04 april 2014 09:00 am');
得到结果:1396602000 
中间还有一个断线连接着呢 。。。。。
那是你的日期格式不对,删掉就可以了
echo strtotime(str_replace('-', '', '04 april 2014 - 09:00 am')); //1396573200
echo strtotime('04 april 2014 09:00 am');
得到结果:1396602000 
中间还有一个断线连接着呢 。。。。。
额,字符串处理问题那。
$str = '04 april 2014 - 09:00 am';
$str1 = explode(-,$str);
$str2 = join( ,$str1);
echo strtotime($str2);
那是你的日期格式不对,删掉就可以了
echo strtotime(str_replace('-', '', '04 april 2014 - 09:00 am')); //1396573200
谢谢~
其它类似信息

推荐信息