php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #47185 modification to date() function
Submitted: 2009-01-21 17:38 UTC Modified: 2017-01-11 16:25 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: pinh3ad at hotmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.2CVS-2009-01-21 (snap) OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: pinh3ad at hotmail dot com
New email:
PHP Version: OS:

 

 [2009-01-21 17:38 UTC] pinh3ad at hotmail dot com
Description:
------------
A nice addition to the date function for month would be a predefined AP-style(Associated press style) month names. (i.e. date("p j, Y"); "p" being the AP month name??). AP-style month abbreviations are used a lot for publication dates and sourcing of content.  AP Month abbreviations are different from a 3 letter abbreviation.(Jan., Feb., March, April, May, June, July, Aug., Sept., Oct., Nov., Dec.). Short month names are spelled out, long names are abbreviated.  This is a fairly common practice editorially speaking. A really nice to have feature include.

Thanks


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-23 21:21 UTC] jani@php.net
-Package: Feature/Change Request +Package: Date/time related -Operating System: any +Operating System: *
 [2014-03-12 14:42 UTC] coden at bravozulu dot bz
I ran into this issue, and the solution I came up with was to write my own <a href="http://bravozulu.bz/2014/03/formatting-months-with-ap-stlye">AP Style month format function</a>. It's actually a pretty simple use of strt_replace() to find month names in PHP date strings and convert them to AP Style. This shouldn't be done on any date that needs further processing, since PHP's other date formatting functions may not be able to consistently read all of the AP style dates.

You can check out the function here:

http://bravozulu.bz/2014/03/formatting-months-with-ap-stlye/
 [2017-01-11 16:25 UTC] heiglandreas@php.net
-Status: Open +Status: Wont fix
 [2017-01-11 16:25 UTC] heiglandreas@php.net
This issue is by now over 7 years old and targets an unsupported version of PHP.

As it is a very special usecase and can be done in userland without issue I'm closing this.

Should need arise feel free to reopen the issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC