Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
374 Vistas


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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
may 22
34160
0
mar 19
4189
0
ene 19
5255
4
feb 24
12511
0
ene 18
4032