Skip to Content
Menu
This question has been flagged
1 Reply
393 Views


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.

Avatar
Discard
Best Answer

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

......

Avatar
Discard
Related Posts Replies Views Activity
2
May 22
34171
0
Mar 19
4196
0
Jan 19
5266
4
Feb 24
12526
0
Jan 18
4040