php 获得时间
echo '今天:'.date('y-m-d').'
';
echo '昨天:'.date('Y-m-d',strtotime('-1 day')).'
';
echo '明天:'.date('Y-m-d',strtotime('+1 day')).'
';
echo '一周后:'.date('Y-m-d',strtotime('+1 week')).'
';
echo '一周零两天四小时两秒后:'.date('Y-m-d G:H:s',strtotime('+1 week 2 days 4 hours 2 seconds')). '
';
立即学习“PHP免费学习笔记(深入)”;
echo '下个星期四:'.date('Y-m-d',strtotime('next Thursday')). '
';
echo '上个周一:'.date('Y-m-d',strtotime('last Monday')).'
';
echo '一个月前:'.date('Y-m-d',strtotime('last month')).'
';
echo '一个月后:'.date('Y-m-d',strtotime('+1 month')).'
';
echo '十年后:'.date('Y-m-d',strtotime('+10 year')).'
';
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号