Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取两个日期之间的天数。如何在 openerp 中实现这一点?我需要将当前日期与过去日期进行比较,并获取两者之间的天数。
在这里看简单的例子。
请参见下面的代码。
from datetime import date d0 = date(2013, 1, 1) d1 = date(2013, 1, 30) delta = d0 - d1 print delta.days
OpenERP 遵循 python 代码
datetime.strptime(current_date, '%Y-%m-%d')