Project

Profile

Help

Issue #2353

closed

UTC must be used when filtering records by date fields

Added by daviddavis about 8 years ago. Updated over 4 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.8.7
Platform Release:
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Documentation, Pulp 2
Sprint:
Quarter:

Description

I looked at the pulp documentation and there's no indication that I can't use non-UTC timezones when filtering by date fields (only that I must use iso8601):

https://docs.pulpproject.org/dev-guide/conventions/criteria.html#search-criteria

However, when I do a unit search with this filter:

{association: {created: {'$gt': '2016-10-19T16:30:31+06:00'}}}

I don't get back this repo_content_units record:

{ "_id" : ObjectId("58076855f4a0b6cf38a0a08e"), "repo_id" : "Default_Organization-Test-nosync", "unit_id" : "7356dfeb-a068-43d8-99e8-47a482c0f55c", "unit_type_id" : "rpm", "updated" : "2016-10-19T12:34:29Z", "created" : "2016-10-19T12:34:29Z" }

When I use UTC, everything seems to work find. This may just be a fix to the documentation saying that datefield filters MUST be in UTC.

Also available in: Atom PDF