summaryrefslogtreecommitdiff
path: root/django/db/models/functions/datetime.py
AgeCommit message (Collapse)Author
2026-02-28Added DatabaseOperations.convert_trunc_expression() hook.Tim Graham
Needed on MongoDB.
2025-07-23Refs #36500 -- Rewrapped long docstrings and block comments via a script.django-bot
Rewrapped long docstrings and block comments to 79 characters + newline using script from https://github.com/medmunds/autofix-w505.
2025-05-27Removed unreachable check for None in TruncBase.convert_value().Tim Graham
2024-01-26Applied Black's 2024 stable style.Mariusz Felisiak
https://github.com/psf/black/releases/tag/24.1.0
2023-07-30Fixed warnings per flake8 6.1.0.Mariusz Felisiak
2023-05-11Fixed #34558 -- Fixed QuerySet.bulk_create() crash with Now() on Oracle.Mariusz Felisiak
2023-01-17Refs #32365 -- Removed is_dst argument for various methods and functions.Mariusz Felisiak
Per deprecation timeline.
2022-10-24Refs #34070 -- Fixed date format in Now() on SQLite.Mariusz Felisiak
Regression in 649b28eab6765cd6b2b40c779a18ecafc99b43d7.
2022-10-03Fixed #34070 -- Added subsecond support to Now() on SQLite and MySQL.Lily Foote
2022-07-06Refs CVE-2022-34265 -- Properly escaped Extract() and Trunc() parameters.Simon Charette
Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2022-07-04Fixed CVE-2022-34265 -- Protected Trunc(kind)/Extract(lookup_name) against ↵Mariusz Felisiak
SQL injection. Thanks Takuto Yoshikai (Aeye Security Lab) for the report.
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-09-16Fixed #32365 -- Made zoneinfo the default timezone implementation.Carlton Gibson
Thanks to Adam Johnson, Aymeric Augustin, David Smith, Mariusz Felisiak, Nick Pope, and Paul Ganssle for reviews.
2021-07-15Refs #32508 -- Raised Type/ValueError instead of using "assert" in ↵Daniyal
django.db.models. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-05-17Fixed #32750 -- Fixed crash of Extract() transform on OuterRef() expressions.Artur Beltsov
Thanks Simon Charette for the review.
2021-03-24Removed trailing whitespaces in error messages.Mariusz Felisiak
2020-10-14Fixed #31640 -- Made Trunc() truncate datetimes to Date/TimeField in a ↵David-Wobrock
specific timezone.
2020-10-14Refs #31640 -- Made Extract raise ValueError when using tzinfo with ↵David-Wobrock
Date/TimeField.
2020-09-02Fixed #31948 -- Added tzinfo parameter to TruncDate() and TruncTime().Joe Jackson
2019-10-02Fixed #30821 -- Added ExtractIsoWeekYear database function and iso_week_day ↵Anatol Ulrich
lookup.
2019-07-12Fixed #30602 -- Made Extract raise ValueError when using unsupported lookups ↵Hasan Ramezani
for DurationField.
2019-03-07Fixed #29754 -- Added is_dst parameter to Trunc database functions.ahbk
2019-01-14Corrected comment in TruncTime database function.Nick Pope
2019-01-08Simplified some imports for database functions.Nick Pope
Used more specific modules to reduce the risk of circular imports.
2018-09-10Fixed #29500 -- Fixed SQLite function crashes on null values.Srinivas Reddy Thatiparthy
Co-authored-by: Srinivas Reddy Thatiparthy <thatiparthysreenivas@gmail.com> Co-authored-by: Nick Pope <nick.pope@flightdataservices.com>
2018-08-23Fixed #29048 -- Added **extra_context to database function as_vendor() methods.priyanshsaxena
2018-08-18Fixed #28649 -- Added ExtractIsoYear database function and iso_year lookup.Sigurd Ljødal
2018-08-07Fixed #29648 -- Fixed crash when using subqueries inside datetime truncation ↵Raphael Michel
functions.
2018-01-27Fixed #28650 -- Added TruncWeek database function.Sigurd Ljødal
2017-10-13Refs #28643 -- Reorganized database functions.Mariusz Felisiak
Thanks Tim Graham for the review.
2017-09-11Fixed #28492 -- Defined default output_field of expressions at the class level.Simon Charette
This wasn't possible when settings were accessed during Field initialization time as our test suite setup script was triggering imports of expressions before settings were configured.
2017-07-31Removed unneeded TruncBase.arity.Sergey Fedoseev
Uneeded since its introduction in 2a4af0ea43512370764303d35bc5309f8abce666.
2017-07-20Fixed #28370 -- Deprecated the context arg of Field.from_db_value() and ↵Tim Graham
Expression.convert_value(). Unused since a0d166306fbdc41f49e6fadf4ec84b17eb147daa.
2017-07-14Fixed #28394 -- Allowed setting BaseExpression.output_field (renamed from ↵Sergey Fedoseev
_output_field).
2017-06-28Fixed #27473 -- Added DurationField support to Extract.Daniel Hahler
2017-06-08Fixed #28103 -- Added quarter extract, truncation, and lookup.Mads Jensen
Thanks Mariusz Felisiak, Tim Graham, and Adam Johnson for review.
2017-02-06Fixed #27802 -- Unified return value of db backend datetime SQL methods.Mariusz Felisiak
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-11-11Fixed #25240 -- Added ExtractWeek and exposed it through the __week lookup.Mads Jensen
Thanks to Mariusz Felisiak and Tim Graham for review.
2016-11-10Removed redundant DateTimeField.register_lookup()s.Tim Graham
DateTimeField inherits these lookups from DateField.
2016-10-27Fixed #27327 -- Simplified time zone handling by requiring pytz.Tim Graham
2016-07-08Fixed #26348 -- Added TruncTime and exposed it through the __time lookup.Simon Charette
Thanks Tim for the review.
2016-07-08Refs #25774, #26348 -- Allowed Trunc functions to operate with time fields.Simon Charette
Thanks Josh for the amazing testing setup and Tim for the review.
2016-05-19Fixed some newlines in imports per isort.Tim Graham
2016-05-18Fixed #25774 -- Refactor datetime expressions into public APIJosh Smeaton