The date/time functions: where do they get the date/time from?

The date/time functions: where do they get the date/time from?

Post by bgold1 » Wed, 26 Nov 2008 06:54:30


I ask this question because I'm currently getting two different
results from the php date/time functions, where one result I get on my
local machine, which appears to be accurate, and I get a different
result (about 5-6 minutes fast) on my site which is hosted by
LFCHosting. Does php get the date/time from the machine on which php
is running, which means if the machine's time if off the php time will
be off? Or does it use some other method? How can I fix this 5-6
minute discrepancy between times?

Thanks.
 
 
 

The date/time functions: where do they get the date/time from?

Post by Jerry Stuc » Wed, 26 Nov 2008 07:25:28


It comes from the machine PHP is running on. The only way to correct it
would be to correct the system clock.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
XXXX@XXXXX.COM
==================

 
 
 

The date/time functions: where do they get the date/time from?

Post by Raymond.Sc » Wed, 26 Nov 2008 08:31:13

On Mon, 24 Nov 2008 17:25:28 -0500, Jerry Stuckle





Correct ! So the only way of synchronize the times is for you to
adjust your local time - or ask your hosting compagny to adjust the
clock of the php serveur ...
 
 
 

The date/time functions: where do they get the date/time from?

Post by pom » Wed, 26 Nov 2008 21:29:05


you could ask the time to a time server, compare it to local time and
put the result in a variable. Now, before showing the time you must add
(or substract) this result to the localtime.

It's a bit complicated, but it works!
 
 
 

The date/time functions: where do they get the date/time from?

Post by George Sex » Thu, 27 Nov 2008 06:27:17


Any hosting company that doesn't have their computer clock synced to an
external time server using NTP is demonstrating a lack of competence.

If they don't fix it and keep it fixed, I would sure look at a different
ISP.

--
George Sexton
MH Software, Inc. - Home of Connect Daily Web Calendar
http://www.yqcomputer.com/