note 18372 added to function.strftime

From: Date: Sun, 20 Jan 2002 15:01:30 +0000
Subject: note 18372 added to function.strftime
Groups: php.notes 
Request: Send a blank email to php-notes+get-25568@lists.php.net to get a copy of this message
Windows users cannot use the %V specifier for strftime as it is not implemented in the OS. Following is a possible workaround to get the ISO weeknumber: function ISOWeek($y, $m, $d) { $week=strftime("%W", mktime(0, 0, 0, $m, $d, $y)); $dow0101=getdate(mktime(0, 0, 0, 1, 1, $y)); if ($dow0101["wday"]>1 && $dow0101["wday"]<5) $week++; elseif ($week==0) $week=53; return(substr("00" . $week, -2)); } -- http://www.php.net/manual/en/function.strftime.php http://master.php.net/manage/user-notes.php?action=edit+18372 http://master.php.net/manage/user-notes.php?action=delete+18372 http://master.php.net/manage/user-notes.php?action=reject+18372

« previous php.notes (#25568) next »