Req #15184 [Wfx->ReO]: Calculate the quarter with date('Q')?

From: Date: Thu, 15 Nov 2018 17:04:38 +0000
Subject: Req #15184 [Wfx->ReO]: Calculate the quarter with date('Q')?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217983@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=15184&edit=1

 ID:                 15184
 Updated by:         requinix@php.net
 Reported by:        j-f at gmx dot net
 Summary:            Calculate the quarter with date('Q')?
-Status:             Wont fix
+Status:             Re-Opened
 Type:               Feature/Change Request
 Package:            *General Issues
 Operating System:   -
-PHP Version:        4.1.1
+PHP Version:        7.2
-Assigned To:        derick
+Assigned To:        
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2018-11-15 15:46:37] love at sickpeople dot se

@requinix: could you please change the status from Wont fix to Open again?

------------------------------------------------------------------------
[2018-10-13 02:39:14] requinix@php.net

If coreutils/date has it then I think it's worth reconsidering - GNU has already decided what a
quarter is and PHP would merely be consistent with that, like it already is when it comes to other
date handling problems.

------------------------------------------------------------------------
[2018-10-13 01:39:06] love at sickpeople dot se

GNU coreutils added support for %q in 2016. See https://savannah.gnu.org/forum/forum.php?forum_id=8745

The value is 1 - 4.

------------------------------------------------------------------------
[2018-07-15 02:39:55] requinix@php.net

Related To: Bug #76622

------------------------------------------------------------------------
[2018-04-23 12:10:18] vickron at yahoo dot com

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')));

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=15184


--
Edit this bug report at https://bugs.php.net/bug.php?id=15184&edit=1


Thread (1 message)

  • requinix@php.net
  • Unknown Message
    • requinix@php.net
« previous php.bugs (#217983) next »