Print Page | Close Window

Get time from iNet time server

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=18011
Printed Date: 29 March 2026 at 10:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Get time from iNet time server
Posted By: Darbs
Subject: Get time from iNet time server
Date Posted: 17 January 2006 at 9:58pm
Anybody done any time server asp (or know of any that you can point me to?)......
 
I require some asp that will contact an internet time server (asp via http) and grab the time from it - I think it should be fairly simple!!
As part of this - a good reliable time server perhaps??  Hey VbScript will do for me!!
 
An atomic time server would be the best solution for what I have in mind if you can help please Big smile...
 
And please no ASP.NET, C# etc solutions cos I've got loads already LOL!!
 
Cheers,


-------------
Who said MSAccess? Not a chance in hell!!
Always available at : http://darbs.hopto.org/



Replies:
Posted By: dpyers
Date Posted: 18 January 2006 at 2:37am
Don't think you can access an NTP service directly through ASP. Most NTP servers use port 37 so you'd need a component/DLL to access the port. Even if you could get it, you couldn't use it to update your system time through asp.

If you just want it for display purposes, you might use ServerXMLHTTP to hit a time service web page and then screenscrape the result. One such site is http://www.worldtimeserver.com/ - http://www.worldtimeserver.com/


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Darbs
Date Posted: 18 January 2006 at 9:56am
Thanks dpyers thats wat I want really - just to display.
I'm not sure how to grab the result from the xmlhttp if anybody knows????
Cheers,


-------------
Who said MSAccess? Not a chance in hell!!
Always available at : http://darbs.hopto.org/


Posted By: Darbs
Date Posted: 18 January 2006 at 12:39pm
I've been sent some php script for this - anybody know how I can parse the php result and get it into an ASP variable?????
 
Cheers....


-------------
Who said MSAccess? Not a chance in hell!!
Always available at : http://darbs.hopto.org/


Posted By: dpyers
Date Posted: 19 January 2006 at 3:09am
ServerXMLHTTP just calls another page and returns the html in a string that you can then parse.
There's an example of how it works at http://www.new2asp.com/Section_Files/PullStrings/PullStrings.asp - http://www.new2asp.com/Section_Files/PullStrings/PullStrings.asp

Just out of curiosity, why do you want to get the time from a time server? Most windows hosts already synch with time.windows.com. Even my Win XP does. Can't you just use your hosts time?


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: Darbs
Date Posted: 19 January 2006 at 11:56am
It's a work arround to log accurate time into DB's where the time source is not accurate....  Old NT4 servers others that don't have a time source enabled....  Not the best thing to do but one of my only choices at the moment....
 
Cheers for the help dypers...


-------------
Who said MSAccess? Not a chance in hell!!
Always available at : http://darbs.hopto.org/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net