← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #209704]: datetime, compare 2 dates, can this be done a smarter way?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
What about:

nowdate = time.strftime("%d-%m-%Y %H:%M:%S")

module time is already imported by Sikuli
strftime() takes now(), if no time given

so that is all
duedate = "26-09-2012 00:00:00"
if duedate <  time.strftime("%d-%m-%Y %H:%M:%S"): print "in the past"

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