← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #258626]: wait until specified time

 

Question #258626 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/258626

    Status: Open => Answered

RaiMan proposed the following answer:
I do not thinks so.

This should do it:

 diff = bt-at
 if diff < 0:
      b = time.struct_time((a[0], a[1], a[2], 23, 59, 0, 0, 0, a[-1]));
      bt = time.mktime(b)
      # now diff contains the time to midnight today
      diff = bt-at
      a = time.struct_time((a[0], a[1], a[2], 0, 0, 0, 0, 0, a[-1]));
      at = time.mktime(a)
      b = time.struct_time((a[0], a[1], a[2], h, m, s, 0, 0, a[-1]));
      bt = time.mktime(b)
      # bt - at adds the time to wait until the given hour tomorrow
      diff = diff + bt - at

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.