Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
270 Visualizações


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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
mai. 22
33851
0
mar. 19
4014
0
jan. 19
5040
4
fev. 24
12258
0
jan. 18
3908