|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-06-06 11:45 UTC] reinor2 at yandex dot ru
Description:
------------
PHP 7.0.18-0ubuntu0.16.04.1 (cli) ( NTS )
Test script:
---------------
date_default_timezone_set("UTC");
echo date("o", strtotime("2017-01-01"));
// or, the same
// echo (new DateTime("2017-01-01"))->format("o");
Expected result:
----------------
2017
Actual result:
--------------
2016
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 12:00:02 2026 UTC |
read the manual and use 'Y' when you mean 'Y' ISO-8601 week-numbering year. This has the same value as Y, except that if the ISO week number (W) belongs to the previous or next year, that year is used instead. (added in PHP 5.1.0) php > echo date("W", strtotime("2017-01-01")); 52