|
- <?php
- $today = '2013-04-19';
- //年
- echo date("Y-m-d", strtotime($today."+3 year"));
- //月
- echo date("Y-m-d", strtotime($today."-1 month"));
- //週
- echo date("Y-m-d", strtotime($today."+10 week"));
- //日
- echo date("Y-m-d", strtotime($today."+10 day"));
- //時
- echo date("Y-m-d", strtotime($today."+2 hour"));
- //分
- echo date("Y-m-d", strtotime($today."+20 minute"));
- //秒
- echo date("Y-m-d", strtotime($today."+5 seconds"));
- ?>
複製代碼
- //加1天5秒
- echo date("Y-m-d", strtotime($today."+1 day 5 seconds"));
- //加1週減2天
- echo date("Y-m-d", strtotime($today."+1 week -2 day"));
複製代碼 |
|