jeeejay
12 years agoContributor
Account for Daylight Saving in aqFile.GetLastWriteTime
Hello,
We have a script where we check for the 'Last Modified' date of a given file and compare it with an expected value. If they do not match, then we perform some other actions.
Since yesterday, the function started reporting a difference for all files - the difference being exactly one hour which is obviously due to daylight saving.
So in Windows Explorer, Date Modified for a particuar file is displayed as 2:30 PM but aqFile.GetLastWriteTime returns 1:30 PM for the same file. I'd like to know the reason for this behavior.
I know I can simply change the expected values, or add a line of code by using aqDateTime.AddHours() to make the comparison pass however; I'm looking for a more robust solution within TestComplete.
We have a script where we check for the 'Last Modified' date of a given file and compare it with an expected value. If they do not match, then we perform some other actions.
Since yesterday, the function started reporting a difference for all files - the difference being exactly one hour which is obviously due to daylight saving.
So in Windows Explorer, Date Modified for a particuar file is displayed as 2:30 PM but aqFile.GetLastWriteTime returns 1:30 PM for the same file. I'd like to know the reason for this behavior.
I know I can simply change the expected values, or add a line of code by using aqDateTime.AddHours() to make the comparison pass however; I'm looking for a more robust solution within TestComplete.