Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
259 มุมมอง


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

......

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 22
33847
0
มี.ค. 19
4008
0
ม.ค. 19
5037
4
ก.พ. 24
12248
0
ม.ค. 18
3903