Forum Discussion

slecault's avatar
slecault
Contributor
12 years ago

aqDateTime.SetSystemDateTime vs DST


I use the following command to set my PC to a fix date and time in the past. 



aqDateTime
.SetSystemDateTime(Project.Variables.MyTestDate);



The project variable is a String and contains "2012-03-30 08:00".



Execution of this code results in the correct date, but since today... the time is off by 1 hour (9h00)



As if something detects that we are going back to a DST period and adjusts the clock automatically.



Any suggestions or is this a bug?


3 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Stephane,


     


    How do you assign a value to the MyTestDate variable?


     

  • The variable is declared and set in the Project - Variables (temporary) tab. The variable is of type String, and the it's initial value is what I posted previously without the quotes "2012-03-30 08:00".

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Stephane,


     


    I cannot reproduce this behavior on my computer. As the SetSystemDateTime method should obtain the Date/Time object, try converting your string to this format by using the StrToDateTime method before calling the method.