1

I need to get the current date in sikuli script. I am using below code snippet in my script, in which DATE has been hardcoded and that need to change on daily basis to run the script daily. I have tried to find in documentation, but couldn't find there. CODE SNIPPET:

type(Key.TAB + "ABC" + Key.TAB + "06-17-2015" + Key.TAB + Key.TAB + Key.DOWN + Key.TAB + Key.TAB + Key.TAB)
RATHI
  • 5,129
  • 8
  • 39
  • 48

1 Answers1

1

Have a look at Pythons time, datetime does not work wel with Sikuli
For example:

import time

now = time.strftime('%c')

# Date 
print ('Date: ' + time.strftime('%x'))
# Time 
print('Current time: ' + time.strftime('%X'))
#Current date and time.
print ('Current time %s' % now )

Change the "06-17-2015" by time.strftime('%m-%d-%y').

Tenzin
  • 2,415
  • 2
  • 23
  • 36