← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #270830]: How to get difference of 2 dates in python

 

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

Mona posted a new comment:
Hello RaiMan,

Thanks for the suggestion

I read the doc before, but couldnt apply anything.

Now, I read that again. I got the solution.

This is the code :

from time import strptime
from datetime import datetime
out="20150827173103"
tdelta = datetime.now() - datetime.strptime(out,"%Y%m%d%H%M%S")
print(tdelta).


Is there any simpler way of doing this? I feel there is still better code.

Thanks in advance

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