I want to get the day of the week for the attendance date that I have to find its equivalent in the working hours table
But I don't know how to get the day of the week from the date.
Thank you for your help.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Financeiro
- Inventário
- PoS
- Project
- MRP
Esta pergunta foi sinalizada
1
Responder
3323
Visualizações
Hi,
Try like following
import datetime
day = self.date.strftime("%A")
It will return the week day name,If we need to get the week day as decimal number,
day = self.date.strftime("%w")
Regards
This is nice!
I can use it in a calculated field as well.
But it return the day in English, can it be translated?
kr,
roeland
Está gostando da discussão? Não fique apenas lendo, participe!
Crie uma conta hoje mesmo para aproveitar os recursos exclusivos e interagir com nossa incrível comunidade!
Inscreva-se
Simple search in google will give you the answer.
check for example :https://pynative.com/python-get-the-day-of-week/#:~:text=We%20can%20use%20the%20weekday,%2C%2002)%20is%20a%20Monday.
Thanks