Date & Time Formatter

datetime_formatter
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/16.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSWeblate, oca-ci, Carolina Fernandez
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/15.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSOCA Transbot, Weblate, OCA-git-bot, oca-ci, tautvydas.banevicius, tbanevicius
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:38
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/14.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSoca-travis, Weblate, OCA-git-bot, dsolanki
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/13.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSOCA Transbot, Víctor Martínez, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:16
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/12.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSOCA Transbot, oca-travis, Weblate, OCA-git-bot, ernesto
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model@api.returns('self')
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/11.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSJairo Llopis, oca-travis, Weblate, Tom Blauwendraat
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:23:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model@api.returns('self')
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/10.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSJairo Llopis, OCA Transbot, oca-travis
WEBSITE
WEBSITEhttps://www.tecnativa.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model@api.returns('self')
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/9.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSPedro M. Baeza, OCA Transbot, oca-travis
WEBSITE
WEBSITEhttps://tecnativa.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model@api.returns('self')
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/8.0/datetime_formatter
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Grupo ESOC Ingeniería de Servicios
COMMITTERS
COMMITTERSJairo Llopis, Stéphane Bidoul (ACSONE), OCA Transbot, oca-travis
WEBSITE
WEBSITEhttps://grupoesoc.es
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (0)

No views found for this module.

Models touched (1)

New fields (0)

No new fields.

Public methods (2)
  • best_match(self, lang=None, failure_safe=True)
    @api.model@api.returns('self')
    Get best match of current default lang. :param str lang: If a language in the form of "en_US" is supplied, it will have the highest priority. :param bool failure_safe: If ``False`` and the best matched language is not found installed, an exception will be raised. Otherwise, the first installed language found in the DB will be returned.
  • datetime_formatter(self, value, lang=None, template=MODE_DATETIME, separator=' ', failure_safe=True)
    @api.model
    Convert a datetime field to lang's default format. :type value: `str`, `float` or `datetime.datetime` :param value: Datetime that will be formatted to the user's preferred format. :param str lang: See :param:`lang` from :meth:`~.best_match`. :param bool failure_safe: See :param:`failure_safe` from :meth:`~.best_match`. :param str template: Will be used to format :param:`value`. If it is one of the special constants :const:`MODE_DATETIME`, :const:`MODE_DATE` or :const:`MODE_TIME`, it will use the :param:`lang`'s default template for that mode. :param str separator: Only used when :param:`template` is :const:`MODE_DATETIME`, as the separator between the date and time parts.
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-tools
PULL REQUEST
PULL REQUEST[MIG] datetime_formatter: Migration to 18.0 (#3554)