跳至內容
選單
此問題已被標幟
1 回覆
346 瀏覽次數


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
33988
0
3月 19
4082
0
1月 19
5123
4
2月 24
12364
0
1月 18
3969