Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming PC Clock

Status
Not open for further replies.

KeithFrench

Programmer
Jul 20, 2001
25
0
0
GB
Having stored the current date & time in variables within ASPECT, how can I use these to set the PC's clock? Will the only way be to use VB to access the Windows API?
 
Keith,

Aspect gets this Infomation from the PC's Clock.

Hank
 
Keith,

Aspect gets the Current Date and Time from the PC Clock. Are you wanting to Re-Adjust the Clock ?? Not sure if this is Possible.

Hank
 
You can't set the value of a system variable via an ASPECT script, so you can't redefine $DATE or $TIME in that method. You'll either need to use a VB app with the correct API call, or you may be able to find a program that will let you set the clock via a command-line argument (your script would call that application via the run command and pass the date and time settings you want).
 
Keith

You could write a VB app that accepts a command-line argument and then call that app from Aspect(as suggested by Knob). This shouldn't be too difficult to do. If you need more info post back here or make a post in the VB forum. I know somebody there will know how to write the VB app.

Matt
 
It's eay enough to set the dte and time from the dos cmd. It won't be accurrate to the second but close enough. Write a two line .bat or .cmd file with

date mmdd/yy
time hh:mm:ss

and execute it
 
It's easy enough to set the date and time from the dos cmd. It won't be accurate to the second but close enough. Write a two line .bat or .cmd file with

date mm/dd/yy
time hh:mm:ss

and execute it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top