This question has been flagged
1 Reply
4325 Views

Good morning,

Please, how to convert datetime to timestamp in odoov8.

Thanks a lot

Avatar
Discard
Author Best Answer

I found it:

Here is the answer.

import time

import datetime

s = "2015-05-27 21:44:38"

f = time.mktime(datetime.datetime.strptime(s, "%Y-%m-%d %H:%M:%S").timetuple())

print f

Enjoy it ;)

Avatar
Discard