Opened 3 weeks ago

Closed 3 weeks ago

Last modified 3 weeks ago

#37482 closed Bug (fixed)

parse_time() docs say UTC offsets give None, but they are ignored

Reported by: ines besrour Owned by: ines besrour
Component: Documentation Version: 6.1
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

docs/ref/utils.txt and the docstring of django.utils.dateparse.parse_time say:
"UTC offsets aren't supported; if value describes one, the result is None."

Since #32892 (Django 4.0), parse_time() returns the time with the offset removed:

parse_time("12:34:56+05:30")

datetime.time(12, 34, 56)

This is intended: tests/utils_tests/test_dateparse.py asserts
parse_time("00:05:23+04:00") == time(0, 5, 23) ("Time zone offset is ignored").
The documentation should say the offset is ignored.

Change History (4)

comment:1 by ines besrour, 3 weeks ago

Owner: set to ines besrour
Status: new → assigned

comment:2 by Jacob Walls, 3 weeks ago

Component: Uncategorized → Documentation
Triage Stage: Unreviewed → Ready for checkin

comment:3 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

Resolution: → fixed
Status: assigned → closed

In 6675dac0:

Fixed #37482 -- Corrected parse_time() docs about UTC offsets.

comment:4 by Jacob Walls <jacobtylerwalls@…>, 3 weeks ago

In ca5019f:

[6.1.x] Fixed #37482 -- Corrected parse_time() docs about UTC offsets.

Backport of 6675dac0ffbaf15eaf725324192de01dc2b17acb from main.

Note: See TracTickets for help on using tickets.
Back to Top