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


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
33851
0
3月 19
4015
0
1月 19
5042
4
2月 24
12258
0
1月 18
3908