← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #149401]: Python datetime instruction issue

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
I am using time.strftime(string, time) for these purposes 
look: http://docs.python.org/library/time.html#time.strftime

(no import time needed, since already available through Sikuli)

e.g.
time.strftime('%Y')

returns a string containing '2011'

if the second parameter time is omitted, it uses the actual localtime()
internally.

So if you run a script and use 
start = time.time()

you may later on say:
time.strftime('%Y', time.localtime(start))

to get the relevant parts of the start time.

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