Jump to content

Recommended Posts

Hi,

I've noticed a strange difference between browsers regarding the PHP time() function. Whenever I access a file (just: <?php echo time(); ?>, no more than that) on my server (not my local server), it returns different timestamps in Firefox and Internet Explorer, a difference of about 45 seconds (I don't know it exact though; I can't refresh both browsers at the same time). If I try the same file on my server running local, both timestamps do match. Is this a problem of my host or am I doing something wrong? Is there another time-function I could use (actually, I don't care whether it's a Unix timestamp or something like that, as long as it doesn't have the strange difference) to try?

http://www.wireweaving.com/time.php

Thanks in advance..
Link to comment
https://forums.phpfreaks.com/topic/14109-unix-timestamp-firefox-differs-from-ie/
Share on other sites

i'm not able to replicate your error using both IE and FF. they seem to be the same, which makes sence because the time is being generated server side before it is sent to the client side broswer.

I suppose if you really wanted to test it you could add a javascript to your test page that tells the page to refresh at a given time -- javascript uses the time on your local computer, so theoretically, both of your browsers will reload at the exact same time (based on the clock in your local system tray) - when the page reloads, it should show the time generated by server and both browsers should show the same time.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.