date and time

Asked by janani pavithra

hi Raiman,
I got the array tips from you and everything is workin fine..
now I have a doubt in getting the system time and date using sikuli..
i have tried the following in my script but i am not getting the output..

import time
type(strftime("%Y%m%d")

can u correct this pl..give the exact code to get the time and date ..
since i dont understand from the link which u gave for the same question previously..

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

if you don't need other time functions:

from time import strftime # makes the name strftime available in your script
type(strftime("%Y%m%d"))

the general way:
import time
type(time.strftime("%Y%m%d"))

since modules have their own namespace.

If you have any problems using type(), try paste() instead (but it corrupts clipboard!)

Revision history for this message
janani pavithra (janani-pavithra) said :
#2

hi RaiMan,
Thanks yar..
this solved my problem..
thanks a lot..