dcsimg
July 16, 2018
Hot Topics:

Getting the Internet Time

  • November 19, 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.

By submitting your information, you agree that developer.com may send you developer offers via email, phone and text message, as well as email offers about other products and services that developer believes may be of interest to you. developer will process your information in accordance with the Quinstreet Privacy Policy.

Sitemap

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