请问 2015-10-10 直接转换成 linux 时间戳有没有直接的函数可以转换的?
回复内容: 请问 2015-10-10 直接转换成 linux 时间戳有没有直接的函数可以转换的?
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')
strtotime('2015-10-10')