Opened 7 years ago

Closed 6 years ago

Last modified 5 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 Changed 7 years ago by Konrad Świat

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

comment:2 Changed 7 years ago by Carl Meyer

Needs documentation: set

comment:3 Changed 7 years ago by Konrad Świat

Needs documentation: unset

I appended the ref/utils.

comment:4 Changed 7 years ago by Tim Graham

Has patch: set
Triage Stage: AcceptedReady for checkin

Looks good, pending some minor comments.

comment:5 Changed 7 years ago by Tim Graham

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Discussion continues on the pull request.

comment:6 Changed 6 years ago by Baptiste Mispelon

Closed #27082 as a duplicated.

comment:7 Changed 6 years ago by Jon Dufresne

Patch needs improvement: unset

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

comment:8 Changed 6 years ago by Tim Graham

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 Changed 6 years ago by GitHub <noreply@…>

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 Changed 5 years ago by Tim Graham <timograham@…>

In a7a36bb:

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

comment:11 Changed 5 years ago by Tim Graham <timograham@…>

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