$start_date = date("Y-m-d H:i:s", strtotime('next Saturday')); $start_week = date("Y-m-d", strtotime("last week")); $end_week = date("Y-m-d", strtotime("this week")); $sat = strtotime('saturday'); $start_date = date("Y-m-d H:i:s", strtotime('Saturday')); $start = strtotime('2 weeks ago');
格式化日期 2011-01-07T12:22:11 各種用法常見于Java提供的介面
echo date("Y-m-d\TH:i:s", strtotime("2011-01-07 12:22:11"));
$source = '2012-07-31'; $date = new DateTime($source); echo $date->format('d.m.Y'); // 31.07.2012 echo $date->format('d-m-Y'); // 31-07-2012