1

如何将 python 日期时间对象转换为 Oracle 数字格式。

datetime object:

datetime.datetime(2012, 9, 23, 0, 0)

need to be converted to number in Oracle,

20120923
4

1 回答 1

3
>>> import datetime
>>> d = datetime.datetime(2012, 9, 23, 0, 0)
>>> d.strftime('%Y%m%d')
'20120923'
>>> int(d.strftime('%Y%m%d'))
20120923
于 2012-11-08T16:25:51.993 回答