jazer Posted February 27, 2006 Share Posted February 27, 2006 Hi TCH'ers, I have submitted this issue through the help desk but I am hoping I can get some assistance here. We've encountered a strange bug of some sort with the date() function in PHP. Here's what's happening: upon calling date(), we are getting times that seem to fluctuate by 2 hours in either direction. You can hit this file to test: http://uwarboretum.org/phpinfo.php Reload it many many times and watch the time change back and forth from 4am to 6am. This is the PHP code from that file. As you can see, we are not doing any manipulation of the timestamp... it seems that the server time coming back is just changing on the fly!! <?php echo "<p>The current time: " . date("g:i:sa") . "</p>"; echo "<p>This is date(\"g:ia\", 39600): [[" . date("g:ia",39600) . "]]</p>"; ?> This is causing all sorts of havoc on our site -- as you can imagine when event dates and times start changing at random. We have already logged this on PHP.net but haven't received any helpful feedback there. I'd really appreciate any insight you folks can provide. Thanks very much! Quote Link to comment Share on other sites More sharing options...
TCH-Don Posted February 27, 2006 Share Posted February 27, 2006 I reloaded many times and it always shows the current time for me. Quote Link to comment Share on other sites More sharing options...
stevevan Posted February 27, 2006 Share Posted February 27, 2006 Welcome to the forums! Loads ok for me too! Quote Link to comment Share on other sites More sharing options...
TCH-Tim Posted February 27, 2006 Share Posted February 27, 2006 Refreshed it 100 times. Looks fine. Quote Link to comment Share on other sites More sharing options...
TCH-Bruce Posted February 27, 2006 Share Posted February 27, 2006 Welcome to the forums. I see the same time on each reload as well. Quote Link to comment Share on other sites More sharing options...
surefire Posted February 27, 2006 Share Posted February 27, 2006 I have several sites that use the PHP date() function for various reasons... some of which are 'mission critical' for the site operation. I can't say I've ever seen erratic date changes. You could easily set up a loop that echos the php date and see if it changes during the loop. Quote Link to comment Share on other sites More sharing options...
jazer Posted February 27, 2006 Author Share Posted February 27, 2006 Thanks everyone, for taking a look. I am still seeing the problem. Look at the attachment. Quote Link to comment Share on other sites More sharing options...
jazer Posted February 27, 2006 Author Share Posted February 27, 2006 More evidence... Quote Link to comment Share on other sites More sharing options...
tdawgie Posted February 27, 2006 Share Posted February 27, 2006 Here's a screenshot annotated with the current time on my PC: And here's a copy of the exact same script on my server: Working fine Quote Link to comment 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.