How to Get Time from Internet

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

There are time servers (time.nist.gov, time.windows.com, etc.). I need to implement a function which gets and parses time from one of those servers. If anyone did something like that already? Any ideas on how to do that?

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Sep 16, 2011
Company: individual

You can use the following code:

Code
Connection = New HTTPConnection("time.nist.gov", 13);
Connection.Get("time.nist.gov", TempFileName);

The file with TempFileName name will contain the string like following:

58012 12-03-29 11:23:33 50 0 0 905.3 UTC(NIST) *

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.