2017-03-02 125 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()