rondog Posted October 12, 2009 Share Posted October 12, 2009 my server says october 12th, 2009 which is correct. The production server says October 19, 2009. What would cause that? Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/ Share on other sites More sharing options...
wshell Posted October 12, 2009 Share Posted October 12, 2009 Where is your server located? Is it Monday there right now? If so that is why. Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935163 Share on other sites More sharing options...
rondog Posted October 12, 2009 Author Share Posted October 12, 2009 ok that is what I thought...let me ask you this then... $nextTime = strtotime("next monday"); $update = mysql_query("UPDATE fd_users SET next_login = '".$nextTime."', last_login = '".time()."', times_logged = times_logged+1 WHERE email = '$username' AND password = '$password'") or die(mysql_error()); strtotime("now") is the same as time(); the last_login field (I used time(); here) shows october 11th which is today, yet the next_login (I used strototime("next monday"); here) field shows october 19th...i dont get it..it should be october 12th Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935166 Share on other sites More sharing options...
rondog Posted October 12, 2009 Author Share Posted October 12, 2009 My Server: strtotime('now'): Oct 11, 2009 strtotime('next monday'): Oct 12, 2009 time(): Oct 11, 2009 Production server: strtotime('now'): Oct 11, 2009 strtotime('next monday'): Oct 19, 2009 //if strtotime(now) is oct 11th, next monday should be oct 12th.... time(): Oct 11, 2009 Something isnt right here... anyone know? Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935181 Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2009 Share Posted October 12, 2009 What are the php versions on the two servers, because php.net has had a significant number of bugs in the strtotime(). Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935184 Share on other sites More sharing options...
rondog Posted October 12, 2009 Author Share Posted October 12, 2009 Ok my server is: 4.4.9 Production server is: 4.3.10-22 Should I put a request in to update it to the latest version of php? Do you think that will fix it? Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935191 Share on other sites More sharing options...
Zane Posted October 12, 2009 Share Posted October 12, 2009 What are the php versions on the two servers, because php.net has had a significant number of bugs in the strtotime(). Ok my server is: 4.4.9 Production server is: 4.3.10-22 Should I put a request in to update it to the latest version of php? Do you think that will fix it? Support for PHP 4 has been discontinued since 2007-12-31. Please consider upgrading to PHP 5. 4.4.9 * Released: 07 August 2008 * Announcement: English * ChangeLog * Download: o PHP 4.4.9 (tar.bz2) md5: 2e3b2a0e27f10cb84fd00e5ecd7a1880 o PHP 4.4.9 (tar.gz) md5: 9bcc1aba50be0dfeeea551d018375548 o PHP 4.4.9 zip package md5: 7395068d5489a9f8abf50c6e4b48622f I'd say so. Quote Link to comment https://forums.phpfreaks.com/topic/177362-strtotimenext-monday/#findComment-935225 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.