February 20, 2019
Hot Topics:

Getting the Internet Time

  • November 20, 2002
  • By Karl Moore
  • Send Email »
  • More Articles »

We recently ran this little-known piece of code as a tip here on VB-World but here it is again in full Technicolor glory two functions allowing you to set your computer clock in code.

Public Sub SetDate(NewDate As Variant)    On Error Resume Next    DateTime.Date = NewDateEnd SubPublic Sub SetTime(NewTime As Variant)    On Error Resume Next    DateTime.Time = NewTimeEnd Sub

And that really is all. You know how to grab the data from time servers, you know how to change it into a real date and you now know how to set the computer clock. Und das ist alles, mon ami!

Page 5 of 6

Comment and Contribute


(Maximum characters: 1200). You have characters left.



Enterprise Development Update

Don't miss an article. Subscribe to our newsletter below.

Thanks for your registration, follow us on our social networks to keep up-to-date