note 90277 deleted from function.date by tularis
| From: | tularis@php.net | Date: | Thu, 09 Feb 2012 20:58:00 +0000 |
| Subject: | note 90277 deleted from function.date by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185992@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
Heads up: The date('W') week number of the year is computed based on Monday, and may not
be exactly what you expect. What is "Week 01" of year 2008? This is different from the
date('z') day number of the year which is computed from January 1 == day zero.
<?php // RAY_date_W.php
echo "<br/>" . date('W', strtotime("December 28, 2008")); // 52
echo "<br/>" . date('W', strtotime("December 29, 2008")); // 01
echo "<br/>" . date('W', strtotime("January 2, 2009")); // 01
if (!date('z', strtotime("January 1"))) echo "<br/>FALSE"; //
FALSE
?>