Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Time Zone Problem in odoo

Subscribe

Get notified when there's activity on this post

This question has been flagged
timezoneportalwebsite
8 Replies
55020 Views
Avatar
Hilar Andikkadavath

I can see so many topics regarding timezone, still, it's not clear about its manipulations on odoo. And also need clarifications for the system behavior for portal users.
NB: - Psql stores DateTime in UTC

3
Avatar
Discard
OdooBot
Yes, you are right. We disscussed the same in the above. Datetime data in db is stored in and according to the users timezone it will get automatically converted and by this way we can handle users from different timezones. While loading the view odoo is actually adding tz context with the stored data. No need of any extra configurations to manage account and reports. 

On Fri, 30 Aug 2019, 11:02 pm Dmitry Somov, <dmitry.somov@gmail.com> wrote:

A new answer on Time Zone Problem in odoo has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

Avatar
Anil Kesariya
Best Answer

Hilar,

Yes, system (database) captures time in UTC format just because odoo allows users to login from anywhere in the world and every person belongs to different country have different timezone.

So, odoo evaluates the time based on the logged in user's timezone. If you don't know about how to set the timezone in users, you can go user's form either from preferences or from setting open the particular user from which you are trying to logged in. system (odoo) will display time according to your (user's) set timezone.

Hope this answer may help you to more clear about timezone.

Regards,

Anil.

8
Avatar
Discard
Hilar Andikkadavath
Author

I know This and I mentioned that in question, thats only applicable on which user is using the orm methods, what is the case of public, and if you are fetching datas through query? Next case is for portal users, some times you have to fetch data as SUPERUSER and you can display data as in format of SUPERUSER TZ

Anil Kesariya

If you want to display the datetime info on website, you need to convert the manually in localise format. you can pytz lib to customise this.

This e.g. may help you.

from datetime import datetime

import pytz

user_tz = self.env.user.tz or pytz.utc

local = pytz.timezone(user_tz)

display_date_result = datetime.strftime(pytz.utc.localize(datetime.strptime(your_date_or_datetime_info, DEFAULT_SERVER_DATETIME_FORMAT)).astimezone(local),"%d/%m/%Y %H:%M%S")

try this.

Hilar Andikkadavath
Author

orm methods returns datetime data according to the users zone. Other cases I used momentJs. above method is also good

Anil Kesariya

@hilar, that's great if you can use momentJs.

Avatar
Ali mughal
Best Answer

In my scenario, I want to subtract two dates but when I fetch the date it gives me UTC time and date.  

#first import this library
from pytz import timezone
#convert the date string into object
now_utc_date=datetime.strptime(now_utc,"%Y-%m-%d %H:%M:%S")
print('utc date and time', now_utc_date)
# now i am changing timezone
now_dubai = now_utc_date.astimezone(timezone('Asia/Dubai'))
print('converted time',now_pacific.strftime("%Y-%m-%d %H:%M:%S")) I hope this code resolve the error
0
Avatar
Discard
Avatar
Dmitry Somov
Best Answer

It has been discussed in the community for a while:
https://www.odoo.com/forum/help-1/question/time-zone-problem-in-odoo-118905
https://www.odoo.com/forum/help-1/question/user-timezone-not-applied-to-report-filters-9478
In my opinion there is a logic behind the default treatment of timezones in Odoo:
1) Transactions are recorded with UTC timestamp for all users (server time is UTC)
2) Transactions are displayed to users in their timezone (UTC +TZ delta)

Impacts:
1) For two users working in various timezones to have identical reports requires setting their time to UTC
2) Some transactions recorded same day (late hours) in Western timezones will be timestamped next day on server and will be shown in the reports for next day
3) Some transactions recorded same day (early hours) in Eastern timezones will be timestamped previous day on server and will be shown in the reports for previous day
4) Reports which do not take time as a parameter (only day) will be shown identical to all users. Some transactions from Western timezones day ends (local time) and Eastern timezones day starts (local time) won’t be shown.

Conclusion:
Accountants should be aware of this behavior and should setup their policies respectively:
1) For the reports taking DAY AND TIME as parameters they should login under a UTC-USER
2) For the reports taking only DAY as a parameter they may login either under a LOCAL TIMEZONE USER or under a UTC-USER

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Error after changing some fields in 'my details' page.
portal website
Avatar
Avatar
1
Jan 23
2850
website.menu access rights for dedicated groups
portal website odoo17
Avatar
0
Feb 25
2199
Make an extranet in Odoo, with content, shop, portal... all only visible to customers who are logged in
portal website v17
Avatar
0
Sep 24
2026
Portal saves multiple inputs from dynamically generated list
portal input website
Avatar
0
Dec 23
2128
website account details on portal_my_details
portal required website
Avatar
Avatar
2
Aug 22
4129
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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