各种时间测试

<?php

$today= date('Y-m-d');
echo 'today: '.$today.'<br><br>';

$one_month = date('Y-m-d',strtotime('-1 month'));
echo '-1 month: '.$one_month.'<br><br>';

$three_month = date('Y-m-d',strtotime('-3 month'));
echo '-3 month: '.$three_month.'<br><br>';

$six_month = date('Y-m-d',strtotime('-6 month'));
echo '-6 month: '.$six_month.'<br><br>';

$on_year = date('Y-m-d',strtotime('-1 year'));
echo '-1 year: '.$on_year.'<br><br>';

$to_date = date('Y-m-d',strtotime('-1 day'));
echo 'to_date: '.$to_date.'<br><br>';

评论

暂无评论