跳至內容
選單
此問題已被標幟
2 回覆
2455 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
1
1月 21
8689
2
7月 20
4695
1
9月 19
13181
2
10月 19
12720
3
6月 25
867