php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15060 include behaviour
Submitted: 2002-01-15 18:18 UTC Modified: 2002-01-16 12:09 UTC
From: joachim dot furrer at web dot de Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.0.6 OS: im guessing, all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joachim dot furrer at web dot de
New email:
PHP Version: OS:

 

 [2002-01-15 18:18 UTC] joachim dot furrer at web dot de
Das Problem ist bei der Ausgabe der Wochenformatierung des Timestamps, dass ab diesem Jahr die Formatierung eine Woche hinterherhinkt---> beginn ist bei 0 und nicht bei 1.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-15 18:31 UTC] 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
 [2002-01-16 07:18 UTC] hholzgra@php.net
seems we have found another bad implementation 
of strftime() :(

setting to feedback as i'm waiting for further info ...
 [2002-01-16 10:07 UTC] joachim dot furrer at web dot 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 10:24 UTC] 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:26 UTC] 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 12:10 UTC] eschmid@php.net
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

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 11:01:30 2024 UTC