Re: Time code!
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 43561
interpreted = N
texte = Bob Minor wrote:> Anybody written a code snippet to grab the time from a time server?> > Sorry for the dual post!> This is not trivial, or IMHO necessary. The OS should be responsible for getting the time correct, not an application.That being said, if the remote time server is running a web server, you can use something like this to get a date string from it: [TCPConnect host=isd.smithmicro.com&port=80] [TCPSend]HEAD / HTTP/1.0[UnURL]%0D%0A%0D%0A[/UnURL][/TCPSend] [/TCPConnect]and you will get the following HTTP headers back: HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Thu, 19 Sep 2002 10:59:00 GMT Connection: Keep-Alive Content-Length: 1270 Content-Type: text/html Set-Cookie: ASPSESSIONIDQGQQGJDC=DFEDPNDDJGBEIKFNDAEPBAEL; path=/ Cache-control: privateIt is left as an exercise for the reader to figure out how to get the Date: header out and interpret it as a time in the local timezone.But seriously, run xntpd or better yet clockspeed on your local server. It is the O/S that should be setting the time, not a usermode application.John-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Bob Minor wrote:> Anybody written a code snippet to grab the time from a time server?> > Sorry for the dual post!> This is not trivial, or IMHO necessary. The OS should be responsible for getting the time correct, not an application.That being said, if the remote time server is running a web server, you can use something like this to get a date string from it: [TCPConnect host=isd.smithmicro.com&port=80] [tcpsend]HEAD / HTTP/1.0[unurl]%0D%0A%0D%0A[/UnURL][/TCPSend] [/TCPConnect]and you will get the following HTTP headers back: HTTP/1.1 200 OK Server: Microsoft-IIS/5.0 Date: Thu, 19 Sep 2002 10:59:00 GMT Connection: Keep-Alive Content-Length: 1270 Content-Type: text/html Set-Cookie: ASPSESSIONIDQGQQGJDC=DFEDPNDDJGBEIKFNDAEPBAEL; path=/ Cache-control: privateIt is left as an exercise for the reader to figure out how to get the Date: header out and interpret it as a time in the local timezone.But seriously, run xntpd or better yet clockspeed on your local server. It is the O/S that should be setting the time, not a usermode application.John-- John PeacockDirector of Information Research and TechnologyRowman & Littlefield Publishing Group4720 Boston WayLanham, MD 20706301-459-3366 x.5010fax 301-429-5747-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
John Peacock
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
AppleScript question (1997)
no global [username] or [password] displayed ... (1997)
Stopping bad HTML propagation ? (1997)
WebDNA problems with Itools 7.3 Upgrade (2004)
Web Catalog 2 demo (1997)
Talk List Suggestions (1997)
Norton Internet Security filtering out WebDNA processsed (2004)
Running _every_ page through WebCat-error.html (1997)
Displaying text and populating form fields (again) (2005)
TCP Connect/send and CGI (2003)
WebCatalog (1998)
Globals folders (2004)
Emailer (1997)
Running 2 two WebCatalog.acgi's (1996)
Calculating a total (2000)
[OT] Don't have a mac to test on? (2004)
[sendmail] problem getting silly now =\ (2000)
protect tag on NT IIS (1997)
Field name-subcategory (1997)
Secure server question (1997)