Bug #15060 Updated: include behaviour
| From: | eschmid@php.net | Date: | Wed, 16 Jan 2002 17:10:04 +0000 |
| Subject: | Bug #15060 Updated: include behaviour | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-77265@lists.php.net to get a copy of this message | ||
ID: 15060
Updated by: eschmid
Reported By: joachim.furrer@web.de
Status: Bogus
Bug Type: Date/time related
Operating System: im guessing, all
PHP Version: 4.0.6
New Comment:
Sure "W" in date() reports "ISO-8601 week number of year, weeks
starting on monday (added in PHP 4.1.0) (Saturday)".
%W and so on belongs to strftime(). "%W - week number of the current
year as a decimal number, starting with the first Monday as the first
day of the first week."
Joachim was looking for a week number starting with 1 (one). The
description is "%V - The ISO 8601:1988 week number of the current year
as a decimal number, range 01 to 53, where week 1 is the first week
that has at least 4 days in the current year, and with Monday as the
first day of the week".
-Egon
Previous Comments:
------------------------------------------------------------------------
[2002-01-16 10:26:06] hholzgra@php.net
"%W - week number of the current year as a decimal number, starting
with the first Monday as the first day of the first week"
January 1st 2001 was a Monday
January 1st 2002 was a Tuesday,
first Monday in 2002 was January 7th
so the days before January 7th are in week 0 as defined
and *please* write english!
------------------------------------------------------------------------
[2002-01-16 10:24:28] eschmid@php.net
Please make a new bug report, if you can´t figure out the difference
between the different formatting strings. IMHO it is not a bug, so read
the "how to report a bug that someone will want to help fix" at
http://bugs.php.net/.
Please make your new bug report in English.
------------------------------------------------------------------------
[2002-01-16 10:07:31] joachim.furrer@web.de
Es ist nicht wirklich ein Problem, denn man kann den Bug mit einem
"kleinen" PHP-Script umgehen. Der Fehler tritt bei der Windows wie auch
bei der Linux Version (4.0.6 getestet) auf und macht sich wie folgt
bemerkbar:
$Woche = strftime ("%W", mktime(0,0,0, date("m"), date("d"),
date("Y")));
echo ($Woche);
Dieses Script sollte eigentlich die aktuelle Woche im Jahr zurückgeben.
Aber seit diesem Jahr beginnt das Ding mit 0 und nicht mit 1 (eben eine
Woche hinterher).
Gruss Joachim
------------------------------------------------------------------------
[2002-01-16 07:18:00] hholzgra@php.net
seems we have found another bad implementation
of strftime() :(
setting to feedback as i'm waiting for further info ...
------------------------------------------------------------------------
[2002-01-15 18:31:55] mfischer@php.net
Keine Ahnung was du uns sagen willst.
1) English
2) Search the bug database for duplicates/solutions first
3) Be more descriptive
4) Provide/Paste a reproduceable self-contained script
------------------------------------------------------------------------
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
http://bugs.php.net/?id=15060
Edit this bug report at http://bugs.php.net/?id=15060&edit=1