$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
echo date("Y-m-d\TH:i:s", strtotime("2011-01-07 12:22:11")); echo date('c',time()); 2016-08-23T16:01:08+08:00
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。