Bug #65730 [Com]: DateTime::format('W') returns wrong week number

From: Date: Fri, 03 Apr 2020 11:19:31 +0000
Subject: Bug #65730 [Com]: DateTime::format('W') returns wrong week number
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226422@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65730&edit=1 ID: 65730 Comment by: ankit at artofcoding dot in Reported by: glavic at gmail dot com Summary: DateTime::format('W') returns wrong week number Status: Not a bug Type: Bug Package: Date/time related Operating System: ALL PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Thanks derick@php.net. I cannot express enough gratitude for not deleting this comment. Previous Comments: ------------------------------------------------------------------------ [2020-02-19 11:31:33] mohsin at pie-solutions dot com Thank you for not deleting this thread/post/bug report. I encountered the same error.. ------------------------------------------------------------------------ [2013-11-27 21:39:02] rodolphe at eveilleau dot fr Thank you for not delete these comments. I encountered the same situation. ------------------------------------------------------------------------ [2013-09-21 20:56:55] derick@php.net Nope, we won't delete it so that we can point other people to it in the future. ------------------------------------------------------------------------ [2013-09-21 18:51:06] glavic at gmail dot com Ah, I found it, it is 'o' format character. Sorry for your trouble. Can you delete this failed bug report? ;) Tnx ------------------------------------------------------------------------ [2013-09-21 18:48:10] glavic at gmail dot com I made a copy/paste typo before, but that doesn't matter now because you said that 'Y' returns the year of the date, which is totally correct, where was my head... I understand what you are saying; I agree that Dec 30 and 31 fall in week 1; but year 2014, not 2013. Maybe I should rephrase my question: how do I get correct week year from "echo (new DateTime('2013-12-30'))->format('W ????');" ? ------------------------------------------------------------------------ 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=65730 -- Edit this bug report at https://bugs.php.net/bug.php?id=65730&edit=1

« previous php.bugs (#226422) next »