NTP - Time Synch?
am 02.08.2007 23:12:42 von ashoreFolks, I need to find and synch some php scripts to a NTP service
somewhere. I'll appreciate any info on just where/how?
-AS
Folks, I need to find and synch some php scripts to a NTP service
somewhere. I'll appreciate any info on just where/how?
-AS
On Aug 2, 4:12 pm, ashore
> Folks, I need to find and synch some php scripts to a NTP service
> somewhere. I'll appreciate any info on just where/how?
>
> -AS
I am pretty sure that you would want to sync the time on your server,
which I do not know if there is a way to sync the time using PHP, but
likely permission to change the ntp syncing on a server through php
likely would be disabled...I may be wrong, but I think you would
probably need to just sync the time using your ntpd daemon or service.
Thanks, but not that complicated. If I can get a valid/accurate
network time, I can then maintain the delta between that and the
server's time, and then use that delta in time-sensitive stuff.
BTW, I just have found a php script for getting ntp time, and now the
job is getting it to work.
AS-
ashore <3ashore@comcast.net> wrote:
>
>Thanks, but not that complicated. If I can get a valid/accurate
>network time, I can then maintain the delta between that and the
>server's time, and then use that delta in time-sensitive stuff.
It's interesting to me that you believe it would be less complicated to add
an NTP client and time adjustment software to your script, than it would be
to just run ntpd on your server and have the server time be correct at all
times.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Tim Roberts wrote:
> It's interesting to me that you believe it would be less complicated to add
> an NTP client and time adjustment software to your script, than it would be
> to just run ntpd on your server and have the server time be correct at all
> times.
He may not have root on his server.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 43 days, 14:00.]
Command Line Interfaces, Again
http://tobyinkster.co.uk/blog/2007/08/02/command-line-again/
Post removed (X-No-Archive: yes)
On Aug 2, 4:12 pm, ashore
> Folks, I need to find and synch some php scripts to a NTP service
> somewhere. I'll appreciate any info on just where/how?
>
> -AS
the ntp daemon is really not complicated at all to setup, if you have
root access to access the server, you can find a lot of simple guides
to get your server setup to sync its time. If you do not have root
access and can not get those that do have it to setup an accurate
time, the previous poster is right, I would look for a new server.
Perhaps I misunderstood a little regarding your subject and message,
but a time sync would mean to me, and probably 99% of others out there
that you want to set the time on your host server to some external
source, not just display some accurate or use said accurate time in
your scripts.
However, if you are wanting to display an accurate time in yoru
scripts for some other time zone or something, ntp is not the best
choice for accomplishing that to just show in your scripts. NTP
should be used to get an accurate time on your server itself, where
the daemon runs constantly and updates its time based on one or more
sources 24x7. You could then use a couple of functions to get a
different time if desired with date, mktime, and time, if for example
you wanted to use a time from a different timezone then your current
hosting server.
Gary L. Burnore wrote:
> If he can't get those who DO have root to run correct time, he should
> use a different server.
True.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.12-12mdksmp, up 43 days, 20:53.]
Command Line Interfaces, Again
http://tobyinkster.co.uk/blog/2007/08/02/command-line-again/
Summing up:
1. This is for use in an Open Source application I'm developing. I
don't want to emburden each potential user with more complexity than
needed. The application needs the time information - not the server.
I expect the app will maintain a delta factor - correct_time minus
server_time.
2. I don't have root access, nor do I expect other installations/
users to have it.
3. I want accurate time cuz there's a need to get a time stamp on
some application events that will correlate with some off-system
events. The latter will have accurate time stamps.
4. No, it need not be NTP. If anyone is aware of a non-NTP solution
that fits the above parameters, please share that info.
5. Meanwhile, I have located a small PHP script that reads like it
will do it, but I'm having trouble getting it to work. It's at
http://www.aota.net/forums/showthread.php?t=21147
Thanks, folks.
-AS
On 2007-08-04, ashore <3ashore@comcast.net> wrote:
> 1. This is for use in an Open Source application I'm developing. I
> don't want to emburden each potential user with more complexity than
> needed. The application needs the time information - not the server.
> I expect the app will maintain a delta factor - correct_time minus
> server_time.
> 2. I don't have root access, nor do I expect other installations/
> users to have it.
> 3. I want accurate time cuz there's a need to get a time stamp on
> some application events that will correlate with some off-system
> events. The latter will have accurate time stamps.
> 4. No, it need not be NTP. If anyone is aware of a non-NTP solution
> that fits the above parameters, please share that info.
> 5. Meanwhile, I have located a small PHP script that reads like it
> will do it, but I'm having trouble getting it to work. It's at
> http://www.aota.net/forums/showthread.php?t=21147
It looks as if the script is targetting a dead time server,
for one thing. Try 0.pool.ntp.org.