Skip to Content
Menu
This question has been flagged
1 Reply
4640 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
Related Posts Replies Views Activity
1
Aug 23
12546
1
Aug 23
11041
1
Jul 23
7222
4
Apr 23
8676
2
Feb 23
17590