<?php header('Content-Type: text/html; charset=utf-8'); echo date('Y-m-d H-i-s'); //相对当前时间 echo '当前时间戳:'.time().' | 当前的时间:'.date('Y-m-d H-i-s' , time());; echo '<br>'; echo '4年后的时间戳:'.strtotime("+ 4 years").' | 4年后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 years")); echo '<br>'; echo '4年前的时间戳:'.strtotime("- 4 years").' | 4年前的时间:'.date('Y-m-d H-i-s' , strtotime("- 4 years")); echo '<br>'; echo '4月后的时间戳:'.strtotime("+ 4 months").' | 4月后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 months")); echo '<br>'; echo '4天后的时间戳:'.strtotime("+ 4 days").' | 4天后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 days")); echo '<br>'; echo '4小时后的时间戳:'.strtotime("+ 4 hours").' | 4小时后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 hours")); echo '<br>'; echo '4分钟后的时间戳:'.strtotime("+ 4 minutes").' | 4分钟后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 minutes")); echo '<br>'; echo '4秒后的时间戳:'.strtotime("+ 4 seconds").' | 4秒后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 seconds")); echo '<br>'; echo '4周后的时间戳:'.strtotime("+ 4 weeks").' | 4周后的时间:'.date('Y-m-d H-i-s' , strtotime("+ 4 weeks")); echo '<br>'; echo '上周六时间戳:'.strtotime("Last Saturday").' | 上周六的时间:'.date('Y-m-d H-i-s' , strtotime("Last Saturday")); echo '<br>'; echo '本周时间戳:'.strtotime("Next Sunday").' | 本周六的时间:'.date('Y-m-d H-i-s' , strtotime("Next Sunday")); echo '<br>'; ?>