php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #49259 Add month 13 to date_parse()
Submitted: 2009-08-14 18:02 UTC Modified: 2009-08-14 23:30 UTC
From: alan at wilcoxengineering dot com Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 5.2.10 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
7 - 2 = ?
Subscribe to this entry?

 
 [2009-08-14 18:02 UTC] alan at wilcoxengineering dot com
Description:
------------
date_parse expects months 1..12 only.

date_parse("13/1/5769")  for  month=13, Ehul in Jewish calendar, results 
in  month==3 instead of month==13.

It does, however, report the error array showing "Unexpected Character."

It would be nice if date_parse could handle the months properly (just 
report back a "13" for the month). The older approach of substr() is my 
workaround.

Reproduce code:
---------------
---
From manual page: function.date-parse
---
date_parse("13/1/5769")  

Expected result:
----------------
Array for month should show 13 instead of 3


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-08-14 23:30 UTC] derick@php.net
The date_parse() function is meant to parse dates in the proleptic Gregorian calendar.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 10:01:32 2024 UTC