MichaelMcFarlan
14 years agoContributor
aqDateTime.SetSystemDateTime not working with Windows 7
I just upgraded from Vista to Windows 7 (64bit) and now the function SetSyStemDateTime function is not working. The function doesn't set the time and always returns false. I'm running this on the Administrator account so that is not the problem. I tried using the example in the helpfile but that actually didn't run due to some errors with SetTimeElements, but even when I adjusted that SetSystemDateTime still didn't work.
function
SettingNewSystemDateTime()
{
dt1=aqDateTime.SetDateTimeElements(2010, 6,
22, 10, 15, 12);
dt2=aqDateTime.SetDateElements(2010, 6,
22);
time=aqDateTime.SetTimeElements(10, 15, 12);
// Setting new
system date and time
aqDateTime.SetSystemDateTime(dt1);
//
Setting new system date
aqDateTime.SetSystemDateTime(dt2);
//
Setting new system time
aqDateTime.SetSystemDateTime(time);
}
function
SettingNewSystemDateTime()
{
dt1=aqDateTime.SetDateTimeElements(2010, 6,
22, 10, 15, 12);
dt2=aqDateTime.SetDateElements(2010, 6,
22);
time=aqDateTime.SetTimeElements(10, 15, 12);
// Setting new
system date and time
aqDateTime.SetSystemDateTime(dt1);
//
Setting new system date
aqDateTime.SetSystemDateTime(dt2);
//
Setting new system time
aqDateTime.SetSystemDateTime(time);
}