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

Hi. I am working with Odoo enterprise web 16.4+e

In my QWeb report, I have a field that getting datetime from Attendance like this:

Currently it is showing 12/03/2024 17:30:10

How can I only show time like 17:30:10 ?

Thanks in advance!

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

Hello,

 <span t-esc="context_timestamp(YOUR_FIELD).strftime('%H:%M:%S')"/>



อวตาร
ละทิ้ง
ผู้เขียน

works perfectly. thanks!

คำตอบที่ดีที่สุด

Hi,

If the field is a Datetime field you can use your_field.strftime.('%H:%M:%S)


Hope it helps

อวตาร
ละทิ้ง
ผู้เขียน

thanks! but in my case, Sahar's answer is more acceptable

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 21
8686
2
ก.ค. 20
4695
Datetime change Format issue in odoo10?? แก้ไขแล้ว
1
ก.ย. 19
13181
2
ต.ค. 19
12719
3
มิ.ย. 25
866