Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

How do datetime fields work in Odoo?

Odoberať

Get notified when there's activity on this post

This question has been flagged
technicalquickstartTechnicalQuickstart
1 Odpoveď
314 Zobrazenia
Avatar
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
Avatar
Zrušiť
Avatar
Abraham Ismael Torales Salazar (aits)
Autor Best Answer

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
Avatar
Zrušiť
Enjoying the discussion? Don't just read, join in!

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

Registrácia
Related Posts Replies Zobrazenia Aktivita
Format Dates in PDF based on Customer Timezone and Language Solved
technical quickstart Technical Quickstart
Avatar
1
nov 25
303
Explaination of Odoo domain filter with simple example Solved
technical quickstart
Avatar
Avatar
2
okt 25
33758
How do I connect the Epson TM-T88VII to Odoo?
quickstart Quickstart
Avatar
Avatar
2
okt 25
992
How to Set Customer-Specific Product Names Solved
quickstart Quickstart
Avatar
1
nov 25
1509
✅ Odoo E-commerce: How to discriminate deliveries based on the type of clients
quickstart Quickstart
Avatar
0
aug 25
1509
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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