İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
133 Görünümler

I have a problem with the date when I realized a book of a room in Odoo. When I am going to do a book, in my form I can select a date with an specific hour, for example:

Start date: 18/08/2025 13:00:00
Finish date: 18/08/2025 13:00:00

But I created an email with the date, and I recived a wrong hours, I think that it is because the timezone is diferent in server and here, but I don´t know how to solve this.
The email received have this:

Hola ssss,

Gracias por tu reserva. Te confirmamos que tu reserva de Sala Talavera se ha efectuado con éxito.

Detalles de la reserva:

  • Sala: Sala Talavera
  • Fecha: 18/08/2025 11:00:00 a 18/08/2025 13:00:00
  • Reservado por: ssss

Si necesitas modifcar o cancelar la reserva, por favor contáctanos con antelación al equipo de IT.

Saludos de parte de todo el equipo!



Please, if someone can help me, I appreciate it a lot!

Avatar
Vazgeç
Üretici

Doesn´t work this solution, I opened a ticket and I have to get an answer

En İyi Yanıt

Hi,


    Odoo stores all datetimes in UTC in the database.


    The user interface converts those datetimes to the user’s timezone (set in their preferences).


    When you send an email and directly insert a datetime field (e.g. ${object.start_date}), Odoo sends the raw UTC value unless you explicitly format it.


    That’s why you see a “wrong” hour in the email — it’s showing UTC, not your local timezone.


You need to format the datetime with timezone conversion in the email template.

Try the code,

            ${format_datetime(object.start_date, tz=user.tz, dt_format="%d/%m/%Y %H:%M")}



Hope it helps

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ağu 25
896
2
Ağu 25
412
2
Ağu 25
490
3
Ağu 25
1294
1
Ağu 25
700