Hello!!
Please, i am using a datetime field. And, i want to convert my datetime field to a date field.
here is what i have tried:
Python:
import time
import datetime
from datetime import datetime, date, time
b = 2015-10-28 16:09:59
d = datetime.now().strftime('%Y-%m-%d')
print d
and i got an error which is :
b = 2015-10-28 16:22:31.515561
^
SyntaxError: invalid syntax
Is here any idea.
Regards
Unrelevant to Odoo/OpenERP itself, use `.date()` as suggested by zbik.
Also use DEFAULT_SERVER_DATETIME_FORMAT . from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
Playing with odoo date field: https://learnopenerp.blogspot.com/2021/07/how-to-use-and-convert-date-field-format-odoo.html