pytz support for filter domains

web_pytz
REPOSITORY
REPOSITORYOCA/web
GIT
GIThttps://github.com/OCA/web.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/web/tree/7.0/web_pytz
VERSION
VERSION 1.0
CATEGORY
CATEGORYDependency
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Therp BV
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Therp BV
COMMITTERS
COMMITTERSAlexandre Fayolle, Holger Brunn
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:07:15
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/web:
    - web_lib_moment
odoo/odoo:
    - web
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Introduction
------------
This module allows complex timezone operations in domains mimicing python's
pytz. The heavy lifting is done by http://momentjs.com/timezone.

It is meant to allow correct filters for 'Today', 'Yesterday' etc.

In addition to implementing a subset of `pytz.tzinfo` and
`datetime.astimezone`, there's a shortcut called `utc_today()` which returns
the beginning of the day in the current user's time zone translated to UTC,
this is equivalent to::

  pytz.timezone(tz).localize(datetime.datetime.now().replace(hour=0, minute=0,
      second=0)).astimezone(pytz.utc)

in python.

Usage
-----

Depend on this module and use filters like::

    [('write_date', '>=', utc_today().strftime('%Y-%m-%d %H:%M:%S'))]

which displays records changed in the user's conception of today.

Code Analysis

Views touched (0)

No views found for this module.

Models touched (0)

No models found for this module.