Date() goes backwards?

software development

#1

I made a test page that just outputs about 100 date(‘Y-m-d H:i:s’);

Occationally (say, 1 out of 30 tries) the time goes backwards by one or two seconds. Like:

2006-11-14 07:29:16
2006-11-14 07:29:16
2006-11-14 07:29:16
2006-11-14 07:29:14
2006-11-14 07:29:14
2006-11-14 07:29:14

Or even reloading the page, the 2nd page will show an earlier time than the first page by one or two seconds.

It’s no big deal. It’s just interesting. I wonder, how can this happen? Something to do with threading? I don’t get it.

Terry


#2

Time() goes backwards too. In my test script I output time() with every Date(). I get things like this:

2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542422)
2006-11-14 14:13:42 (1163542422)
2006-11-14 14:13:42 (1163542422)
2006-11-14 14:13:42 (1163542422)
2006-11-14 14:13:42 (1163542422)
2006-11-14 14:13:42 (1163542422)
2006-11-14 14:13:42 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)
2006-11-14 14:13:44 (1163542424)

I assume Date is just generated from time().


#3

Same problem with microtime(true):

2006-11-14 14:22:35 (1163542955) (1163542955.5044)
2006-11-14 14:22:35 (1163542955) (1163542955.5045)
2006-11-14 14:22:35 (1163542955) (1163542955.5046)
2006-11-14 14:22:35 (1163542953) (1163542953.9029)
2006-11-14 14:22:33 (1163542953) (1163542953.903)
2006-11-14 14:22:33 (1163542953) (1163542953.9031)
2006-11-14 14:22:33 (1163542953) (1163542953.9032)

This is during a single run on a single page. I just copy and pasted.


#4

There was a thread about something like this. I don’t recall the details, but I thought it had to do with the time zone you are in compared to the server. But then again I could be dreaming. lol. Hope you figure it out.
Silk

My website


#5

There is a previous thread on a similar “borkedness”. In this thread, the similar problem was determined to be a kernel parameter issue, that DH support was able to fix.

–rlparker


#6

Thanks for the reference. I hadn’t seen that.

I contacted support too, and they said the same thing: that it was a kernel param, and that it should be fixed - but, it’s not. I replied back showing that the problem is exactly the same. So, the saga continues.

Terry


#7

In reply to the 2nd support email about this and the cron problem, they had this to say, and it appears to be running great now:

“Most likely the same issue, but I have restarted cron, just in case. The
time problem is due the server running the wrong kernel, and that is
scheduled to be updated tonight.”

Terry