Problem No of weeks returned by date function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
 I want to display a report per week.

 I am facing a problem with php date function.

 date() function returns week 1 for a date in last year.

 <?php
  $ts = mktime(0, 0, 0, 12, 29, 2003);
  echo date("W", $ts);

 // returns 1. Is this a bug
 ?>


 But mysql week function returns 53.

 select week('2003-12-29', 1)

 I am losing the data for week 53 because I have to display week using php
and then hits for that week using mysql records.

 I am using PHP Version 4.3.6 on Windows 2000.

 Is this a php bug where it is assumed that there can be just 52 weeks in a
year? If yes then how mysql displays week from 0 to 53?

--Sukhwinder Singh

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux