Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#25181 closed New feature (fixed)

Add a localdate() function to get date in a different time zone

Reported by: Tim Graham Owned by: Konrad Świat
Component: Utilities Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Carl says, "That's the most straightforward implementation I know of. I think it would make sense as timezone.today(). I've reimplemented it in at least two projects. Also, the first time I implemented it I left out the .localtime() and didn't catch the bug for quite a while. An argument for adding it to Django."

Change History (11)

comment:1 by Konrad Świat, 9 years ago

Owner: changed from nobody to Konrad Świat
Status: newassigned

comment:2 by Carl Meyer, 9 years ago

Needs documentation: set

comment:3 by Konrad Świat, 9 years ago

Needs documentation: unset

I appended the ref/utils.

comment:4 by Tim Graham, 9 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

Looks good, pending some minor comments.

comment:5 by Tim Graham, 9 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Discussion continues on the pull request.

comment:6 by Baptiste Mispelon, 8 years ago

Closed #27082 as a duplicated.

comment:7 by Jon Dufresne, 8 years ago

Patch needs improvement: unset

New PR based on kswiat's original work. It incorporates the feedback from the previous reviews.

comment:8 by Tim Graham, 8 years ago

Summary: Move views.generic.dates.timezone_today() to utils.timezoneAdd a localdate() function to get date in a different time zone
Triage Stage: AcceptedReady for checkin

comment:9 by GitHub <noreply@…>, 8 years ago

Resolution: fixed
Status: assignedclosed

In ff1e7b4e:

Fixed #25181 -- Added localdate() function to get date in a different time zone.

Thanks Konrad Świat for the original patch.

comment:10 by Tim Graham <timograham@…>, 6 years ago

In a7a36bb:

Refs #25181 -- Updated timezone.now() docs about obtaining the time in the current time zone.

comment:11 by Tim Graham <timograham@…>, 6 years ago

In 2679cdbe:

[2.0.x] Refs #25181 -- Updated timezone.now() docs about obtaining the time in the current time zone.

Backport of a7a36bb4d8ef7f03c2df9e3279c8f488ab3641d1 from master

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