Can not use datetime.strptime in windows


I want to get the "
A = Value" of a datetime SQLTag
add X seconds

And compare the result to another datetime.datetime( now() )

I searched in forum, found reference to strptime. However it does not work in windows (apparently not implemented). How to convert and SQLTag standard datetime to “datetime” python format (so I can use timedelta function) ?


what have you tried?

I have had no difficulty using datetime.strptime in windows; the hardest part is often finding the right format string to use.

from datetime import datetime

fmt = '%Y-%m-%d %H:%M:%S'
thenTime ="thenTime").value
nowTime ="nowTime").value
convertedThenTime = datetime.strptime(thenTime, fmt)
convertedNowTime = datetime.strptime(nowTime, fmt)

diffTime = (convertedNowTime-convertedThenTime).seconds