How can you set the system date/time with vb.net?

  • Thread starter Thread starter tahuya_rat
  • Start date Start date
T

tahuya_rat

Seems like it should be pretty simple to me, but I'm coming up short
on answers. I'm not trying to find out how to sync to an atomic clock
or anything like that, I just want to know the procedure for setting
the date/time to whatever I may want.

TIA

-jim
 
tahuya_rat said:
I'm not trying to find out how to sync to an atomic clock
or anything like that, I just want to know the procedure for setting
the date/time to whatever I may want.

VB provides

'DateAndTime.TimeOfDay'
'DateAndTime.TimeString'
'DateAndTime.Today'
'DateAndTime.DateString'

which can be set to the desired date/time.

Alternatively you can use p/invoke on 'SetSystemTime':

<URL:http://www.google.de/groups?selm=#adlX7$fCHA.2284@tkmsftngp11>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top