跳至内容
菜单
此问题已终结
1 回复
262 查看


I am trying to use date objects.

And i want to extract the month from this field.

Please who can help me i need it please.

形象
丢弃
最佳答案

from datetime import datetime

from openerp.tools import DEFAULT_SERVER_DATE_FORMAT

......

month = date_field and datetime.strptime(date_field, DEFAULT_SERVER_DATE_FORMAT).month

......

形象
丢弃
相关帖文 回复 查看 活动
2
5月 22
33847
0
3月 19
4008
0
1月 19
5037
4
2月 24
12248
0
1月 18
3904