By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,112 Members | 1,584 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,112 IT Pros & Developers. It's quick & easy.

NTP - Time Synch?

P: n/a
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

Aug 2 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
On Aug 2, 4:12 pm, ashore <shor...@gmail.comwrote:
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.

Aug 2 '07 #2

P: n/a
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-

Aug 3 '07 #3

P: n/a
ashore <3a*****@comcast.netwrote:
>
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, ti**@probo.com
Providenza & Boekelheide, Inc.
Aug 3 '07 #4

P: n/a
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/0...nd-line-again/
Aug 3 '07 #5

P: n/a
On Aug 2, 4:12 pm, ashore <shor...@gmail.comwrote:
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.

Aug 3 '07 #6

P: n/a
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/0...nd-line-again/
Aug 3 '07 #7

P: n/a
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

Aug 4 '07 #8

P: n/a
On 2007-08-04, ashore <3a*****@comcast.netwrote:
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.
Aug 7 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.