首页 > 请问 2015-10-10 直接转换成 Linux 时间戳有没有直接的函数可以转换的?

请问 2015-10-10 直接转换成 Linux 时间戳有没有直接的函数可以转换的?

请问 2015-10-10 直接转换成 Linux 时间戳有没有直接的函数可以转换的?


strtotime('2015-10-10')


echo strtotime('2015-10-10');

对于strtotime不支持的格式,比如 2015年10月1日 ,则可以:

$arr = date_parse_from_format('Y年m月d日', '2015年10月1日');
echo mktime(0, 0, 0, $arr['month'], $arr['day'], $arr['year']); 
//mktime 参数顺序:时,分,秒,月,日,年

strtotime('2015-10-10')

【热门文章】
【热门文章】