php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64242 Extend date() formats with week number of year, weeks starting on Sunday
Submitted: 2013-02-19 07:14 UTC Modified: 2014-05-29 09:49 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: thbley at gmail dot com Assigned: kriscraig (profile)
Status: Not a bug Package: Date/time related
PHP Version: 5.5.0alpha4 OS: ANY
Private report: No CVE-ID: None
 [2013-02-19 07:14 UTC] thbley at gmail dot com
Description:
------------
Extend date() formats like
  W	ISO-8601 week number of year, weeks starting on Monday
with
  V	week number of year, weeks starting on Sunday

Example:
date("W V", strtotime("2012-12-30")); // 52 53
date("W V", strtotime("2012-12-31")); // 01 53

E.g. MySQL has date_format() formats:
  %V	Week (01..53), where Sunday is the first day of the week; used with %X
  %v	Week (01..53), where Monday is the first day of the week; used with %x


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-19 18:26 UTC] kriscraig@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kriscraig
 [2013-09-22 22:08 UTC] derick@php.net
PHP implements the ISO 8601 calendar, where weeks start with Monday - this should not be implemented.
 [2014-05-29 09:49 UTC] kriscraig@php.net
-Status: Assigned +Status: Not a bug
 [2014-05-29 09:49 UTC] kriscraig@php.net
Per Derick's suggestion.  Though I agree there could be valid uses for something like this, implementing it would break standards compliance.

If you would like to pursue this further, please submit an RFC and make your case on the Internals list.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC