note 38592 added to function.date

From: Date: Mon, 29 Dec 2003 08:35:34 +0000
Subject: note 38592 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-62623@lists.php.net to get a copy of this message
If you are using the W format character (ISO-8601 week number of year) and the Y format character, the week may loop back to 1 in late December: <? $endofyear = mktime(0, 0, 0, 12, 30, 2003); echo(date("Y-W\n", $endofyear)); ?> will return 2003-1. If you want the correct year (correct for ISO-8601's week number), use strftime's %G and %V specifiers: <? $endofyear = mktime(0, 0, 0, 12, 30, 2003); echo(strftime("%G-%V\n", $endofyear)); ?> will return 2004-01. ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38592 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38592&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38592&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#62623) next »