Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3337 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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