Getting the Internet Time
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
This article was originally published on November 20, 2002