Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 603323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:55:06+00:00 2026-05-13T16:55:06+00:00

Using the timestamp of PHP’s time() function, I show the current time to the

  • 0

Using the timestamp of PHP’s time() function, I show the current time to the user with date().

Format: H:i => 13:57

But sometimes there seem to be leaps in time. My windows clock was showing 13:40 when I visited the page. But my website said 14:XX. I don’t know the exact time any more.

Another example: A user accessed the page “Who is online?” at 00:16. A user was listed with the time for his last action being 00:39. The last action time is written to the database on every page load. So the time() function must have given back 00:39 at 00:16 and the wrong value must have been written to the database.

How could this happen?

Thank you very much for your help 🙂

Edit #1 I’ve reduced my code to the parts which are important for this problem:

I save the timestamp to a new variable with $tStamp = time() in serverData.php and this file is included in index.php where I show the time to the user with date(‘d.m.Y, H:i’, $tStamp). The variable $tStamp isn’t changed in any other line.

Edit #2 Users on my website noticed a wrong time on 2010-01-21 00:16 where the page showed 00:39 for a very short moment. I’ve had a look into the log files and around this time there’s one complete hour missing in the logfiles:

127.0.0.1 – – [20/Jan/2010:23:34:53 +0100] …

127.0.0.1 – – [20/Jan/2010:23:34:55 +0100] …

127.0.0.1 – – [21/Jan/2010:00:38:41 +0100] …

127.0.0.1 – – [21/Jan/2010:00:38:41 +0100] …

My hoster announced maintenance work for 2010-01-20 00:00-06:00. Do you think that the maintenance was set back? Could it be the case that the maintenance work was done on the next day in this time period? Could such a work make the time wrong?

Edit #3 Finally, I have an answer from my hoster 🙂 In the given period of time, the server crashed. And because of that the watch/clock stopped. It was that simple but I didn’t think of a server crash. Thank all of you very much!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:55:06+00:00Added an answer on May 13, 2026 at 4:55 pm

    Having read all of this question and your responses in comments, I can say that the chances of this being a bug in PHP are pretty infinitesimal. PHP’s time() pulls directly from the OS, which pulls directly from the hardware clock on the mainboard. Since you’re on shared hosting, you’re going to have to ask your host to look into it if this is happening often enough to be a problem. It could be a rogue NTP server or process, it could be some sort of short in the hardware clock — without access to the server logs or physical access to the computer, there’s not a whole lot that you can do personally that I know of.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.