|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-01-23 11:44 UTC] j-f at gmx dot net
I added a note how to calculate the quarter:
ceil(date('n')/3);
But I suggest extending date() with the option 'Q' or 'q'.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
if cannot implement date('q') at least should implemented strtotime('first day of quarter') ... its annoying using some interpreted code just to wrap around this... ceil(date('n')/3) just return the quarter number... need to calc month 1 to 1-january 2-april 3-july and 4-october using first_month_of_quarter = ceil(date('n')/3) * 3 -2; date('Y-m-d', mktime (0,0,0,ceil(date('n')/3) * 3 -2,1,date('Y')));