php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34932 Quarter as parameter in the Date function
Submitted: 2005-10-20 16:32 UTC Modified: -
Votes:4
Avg. Score:4.5 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: sandved at gmail dot com Assigned:
Status: Open Package: Feature/Change Request
PHP Version: 5.1.0RC3 OS:
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-10-20 16:32 UTC] sandved at gmail dot com
Description:
------------
(I tried to add an argument to http://bugs.php.net/bug.php?id=15184 but didn't succeeded):

The Date function may need a way to display a quarter defined standard (in SQL for example) as follow

Value Description
1 - Period January/March
2 - Period April/June
3 - Period July/Sep
4 - Period Oct/December

by using Q as an parameter as in SQL - http://www.techonthenet.com/oracle/functions/to_date.php

Reproduce code:
---------------
new feature

Expected result:
----------------
date('Y\-\QQ') returns 

2005-Q1 for all dates 2005-01-01/2005-03-31
2005-Q2 for all dates 2005-04-01/2005-06-30
2005-Q3 for all dates 2005-07-01/2005-09-30
2005-Q4 for all dates 2005-10-01/2005-12-31

Ex:
2005-Q1 for the date 2005-02-09
2005-Q4 for the date 2005-12-14

Actual result:
--------------
new feature

Patches

add-date-quarter-support (last revision 2013-04-01 15:50 UTC) by programming at stefan-koch dot name)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 09:02:23 2014 UTC