2017-03-02 60 views

回答

2

這裏創建一個簡單的Python datetime.datetime實例本身。

對於python小於2.x

您可以做。

my_model = MyModel() 
int(my_model.create.strftime('%s')) 

對於Python 3.3+

你可以做

my_model = MyModel() 
my_model.create.timestamp()