How to get SUT Time

We have tried the below methods but all are inconsistent

1. Screen capture the time on the SUT. -(Sometimes its failing with OCR issues) 
Using OCR, isolate the searchRectangle to the system's clock. Then readtext() and save the read text to a variable myTime.

2. Math! (This will fail if run from different location)
Given your current system's date and time, you should always be able to calculate the time of any given timezone. Currently, that would work out as:

set SUT_time to the date minus 10 hours 30 minutes
To make this compatible with daylight saving's time, you'll have to use an if statement. That might look something like this:
set CST to the date minus 10 hours 30 minutes
if CST is between "Mar 11" and "Nov 4" then
    add 1 hour to CST
end if

So ,please help me on this to getting SUT by using eggplant syntax or something else which is constant.

Thanks,
Sethupathi
Tagged:
Sign In or Register to comment.