Re: #21212 [Opn->Bgs]: strftime fails when crossing year

From: Date: Mon, 30 Dec 2002 18:49:17 +0000
Subject: Re: #21212 [Opn->Bgs]: strftime fails when crossing year
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969350505@lists.php.net to get a copy of this message
On 30 Dec 2002 pollita@php.net wrote: > Please note the manual page: > http://www.php.net/manual/en/function.strftime.php > > ---------------------------- > %G - The 4-digit year corresponding to the ISO week number (see %V). > This has the same format and value as %Y, except that if the ISO week > number belongs to the previous or next year, that year is used instead. > > > ---------------------------- > > A reminder about ISO week numbers. They begin on mondays, end on > sundays, and are considered a part of the year in which the majority of > their days fall. > > 12/31/2001 falls on a monday, it's ISO week ends on Sunday 1/6/2002, > (six days fall in 2002, one falls in 2001) ergo %G for that date > returns "2002". > > This is expected behavior for %G. Try using %Y instead. Maybe we can add this nice example to the manual? Derick -- ------------------------------------------------------------------------- Derick Rethans http://derickrethans.nl/ JDI Media Solutions http://www.jdimedia.nl/ PHP Magazine - PHP Magazine for Professionals http://php-mag.net/ -------------------------------------------------------------------------

« previous php.doc (#969350505) next »