Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

How do datetime fields work in Odoo?

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
technicalquickstartTechnicalQuickstart
1 Відповісти
319 Переглядів
Аватар
Abraham Ismael Torales Salazar (aits)

I want to know how Odoo manages the different timezones and date format for the Backend and PDFs


Version: 19


Related forum post: Format Dates in PDF based on Customer Timezone and Language

0
Аватар
Відмінити
Аватар
Abraham Ismael Torales Salazar (aits)
Автор Найкраща відповідь

Backend

Datetime fields shown in the backend consider the timezone set in your device (ex. the computer you are working on). 

Timezone in Computer
Backend field
Mexico City, Mexico
Tokyo, Japan

The date and time format is taken from the user language:
Language
Setting
Spanish (Latin America) / Español (América Latina)
English (US)

💡
Odoo saves the datetime field value in UTC time, but when you see it in Odoo, the time is "converted" based on your device timezone and with the user language format.


When using filters, you should put your specific time, and Odoo will look for the field raw value (in UTC).



You can also do some other configurations using Studio, like showing the month in numbers or name, or choosing whether or not to show hours or seconds.


PDF

When we add a datetime field to a PDF Report using the "/" command, the time shown considers the user timezone when downloading the PDF.

The date and time format is taken from the user language

💡
This means that you may have a timezone set in your computer, and another in your user, and you may see different times between the backend and the PDF. For the PDF, the computer timezone doesn't matter, only for the backend.

This also gives us the possibility of changing the user's timezone and/or language to match the one from the person we want to send this PDF to.



Examples:

User Language
User Time zone
Result in the PDF Report
Spanish (Latin America) / Español (América Latina)
Mexico City, Mexico
Spanish (Latin America) / Español (América Latina)
Tokyo, Japan
English (US)
Tokyo, Japan
English (US)
Mexico City, Mexico

PDF (Advanced)

If you edit the source code of the PDF Report, you will see that the field was added with a t-field.

In case we use t-out/t-esc instead of t-field, the PDF will show the time in UTC, ignoring any language format we talked about earlier.
 
If you want to format the datetime, you could do it as follows:
For showing only date using t-field or t-out:
<span t-field="doc.x_studio_datetime" t-options="{'widget': 'date'}"/>
For custom date and time format using t-out or t-esc:
<span t-out="doc.x_studio_datetime.strftime('%d/%b/%Y %I:%M %p')"/>

Date components

Time components

Code Meaning
%Y Year (4 digits)
%y Year (2 digits)
%m Month (zero-padded)
%B Month name
%b Abbreviated month name
%d Day of month (zero-padded)
%e Day of month (space-padded) (Unix only)
%j Day of year
Code Meaning
%H Hour (24-hour)
%I Hour (12-hour)
%p AM / PM
%M Minute
%S Second
%f Microseconds

Week / Weekday

Quick preset

Code Meaning
%A Weekday name
%a Abbreviated weekday
%w Weekday number (0=Sunday)
%u Weekday number (1=Monday)
%U Week number (Sunday first)
%W Week number (Monday first)
Code Meaning
%x Locale date
%X Locale time
%c Locale date & time


💡
For standard reports, user timezone still applies, but language format may be linked to partner_id in the QWeb Code in t-lang attribute.

<t t-call="sale.report_saleorder_document" t-lang="doc.partner_id.lang"/>

⚠️
Be careful when editing the PDF code. Incorrect modifications may cause errors when generating or downloading the PDF. For best practices and detailed guidance, please refer to your Odoo Advisor.


Artificial Intelligence

For AI fields, if you add a prompt specifying a certain hour/time, it will be set in UTC. But when you see it in the backend, it will be shown in your device timezone. Example:

Prompt
Result in Odoo Backend for Mexico City timezone

You could also take other datetime fields for the AI prompt
Prompt
Result in Odoo Backend


Extra: contacts timezone

By default, contacts are generated with the timezone of the user that creates it. 
You can see the timezone for each contact by showing the field using Studio.
Moreover, you can also add the field that shows the difference between UTC and the selected timezone for that contact.

1
Аватар
Відмінити
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
Format Dates in PDF based on Customer Timezone and Language Вирішено
technical quickstart Technical Quickstart
Аватар
1
лист. 25
303
Explaination of Odoo domain filter with simple example Вирішено
technical quickstart
Аватар
Аватар
2
жовт. 25
33762
How do I connect the Epson TM-T88VII to Odoo?
quickstart Quickstart
Аватар
Аватар
2
жовт. 25
994
How to Set Customer-Specific Product Names Вирішено
quickstart Quickstart
Аватар
1
лист. 25
1530
✅ Odoo E-commerce: How to discriminate deliveries based on the type of clients
quickstart Quickstart
Аватар
0
серп. 25
1510
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now