Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6442 Lượt xem

Hi,

Please I have date fields on my odoo application and I have changed the date format to dd-mm-yyyy  from the Settings>Language menu. However, when I export my data to excel, the date is not fromatted the same way. I have a feeling that this has to be done from postgres. Can someone please help?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I, hope you

 SELECT

((po.date_order AT TIME ZONE 'UTC' AT TIME ZONE 'BOT')::date) as date

,((po.create_date AT TIME ZONE 'UTC' AT TIME ZONE 'BOT')::timestamp) as datetime

,to_char(((po.date_order AT TIME ZONE 'UTC' AT TIME ZONE 'BOT')::date), 'DD/MM/YYYY') as date_format

,to_char(((po.create_date AT TIME ZONE 'UTC' AT TIME ZONE 'BOT')::timestamp), 'DD/MM/YYYY HH:MM:SS') as datetime_format

FROM purchase_order AS po

WHERE ((po.date_order AT TIME ZONE 'UTC' AT TIME ZONE 'BOT')::date) BETWEEN '2015-01-01' AND '2016-05-31';


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 6 25
410
1
thg 1 25
17440
1
thg 1 20
3545
1
thg 12 19
5855
1
thg 12 19
16804