jimfog Posted January 25, 2012 Share Posted January 25, 2012 Take a look at the code below: $_REQUEST["month"] = date("n");$_REQUEST["year"] = date("Y");$cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"];$timestamp = mktime(0, 0, 0, $cMonth, 1, $cYear);$thismonth = getdate($timestamp);$startday = $thismonth['wday']; The strange with the above is that $startday outputs 0 to the browser while it should output 3-as it is Wednesday today. What do you think? Does the answer lie somewhere here: $timestamp = mktime(0, 0, 0, $cMonth, 1, $cYear); In the 1 appearing in the mktime function appearing above? Link to comment Share on other sites More sharing options...
birbal Posted January 25, 2012 Share Posted January 25, 2012 $timestamp = mktime(0, 0, 0, $cMonth, 1, $cYear);1 is refering the day of this month. which is not today's date.http://php.net/mktime Link to comment Share on other sites More sharing options...
jimfog Posted January 25, 2012 Author Share Posted January 25, 2012 SO, it is referring to the first day of the month, correct? Link to comment Share on other sites More sharing options...
birbal Posted January 25, 2012 Share Posted January 25, 2012 yes if you put todays day 25 will show you tthe correct one$timestamp = mktime(0, 0, 0, $cMonth, 25, $cYear); Link to comment Share on other sites More sharing options...
jimfog Posted January 25, 2012 Author Share Posted January 25, 2012 And sth else. About [wday] of getdate() function. Is Sunday denoted by 0-meaning the first of the week?Is that correct? Thanks again. Link to comment Share on other sites More sharing options...
birbal Posted January 25, 2012 Share Posted January 25, 2012 yes you are right,if you look into the manual of http://php.net/getdate getdate() you will found brief info about it. Link to comment Share on other sites More sharing options...
jimfog Posted January 25, 2012 Author Share Posted January 25, 2012 Thank you very much. I do not need sth else(for now). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.