1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| function weekFirstDay($time=null) { $time = ($time==null) ? time() : $time; return date('Y-m-d', $time-86400*(date('N',$time)-1)); } function monthFirstDay() { return date('Y-m-d', mktime(0,0,0,date('n'),1,date('Y'))); } function quarterFirstDay() { return date('Y-m-d', mktime(0,0,0,date('n')-(date('n')-1)%3,1,date('Y'))); } function yearFirstDay() { return date('Y').'-01-01'; }
|