扫码关注官方订阅号
请问 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')
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
对于strtotime不支持的格式,比如 2015年10月1日 ,则可以:
strtotime('2015-10-10')
strtotime('2015-10-10')