Re: Time code!
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 43562
interpreted = N
texte = If your running OSX you can just drop into the [shell] to do this ..[!] The below line will query a time server for current time It will not update the time and will create an error on OSX as no 'sudo' command was used .. Never the less - the time is returned [/!][shell]ntpdate -u -d[/shell]The do some fancy [middle]ing around the response .. Save heaps of timelearning the protocol ntp speaks ..Alain> 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: private> > It 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-------------------------------------------------------------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:
If your running OSX you can just drop into the [shell] to do this ..[!] The below line will query a time server for current time It will not update the time and will create an error on OSX as no 'sudo' command was used .. Never the less - the time is returned [/!][shell]ntpdate -u -d[/shell]The do some fancy [middle]ing around the response .. Save heaps of timelearning the protocol ntp speaks ..Alain> 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: private> > It 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-------------------------------------------------------------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/
Alain Russell
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:
[WebDNA] jQuery validation and webdna (2015)
nslookup (2000)
Memory Error message (1998)
Customer - again (1998)
Email (1998)
WCS Newbie question (1997)
sort problems....bug or brain fart? (1997)
website pro trouble (1998)
Make sure I understand this??? (1997)
2.1b2 was SLOW ... but 2.1b3 is FAST! (1997)
Summing fields (1997)
Upgrading old WebCat Database Files (1997)
New command suggestion (1997)
Multiple Newcarts (1996)
Signal Raised Error (Part II) (1997)
Itools, WEBCAT OSX (2003)
[AppendFile] problem (WebCat2b13 Mac .acgi) (1997)
Ampersand (1997)
Search returns all, not 20 (1997)
Multiple catalog databases and showcart (1997)