Re: [Django] #12666: Setting for sending email using localtime instead of UTC

5 views
Skip to first unread message

Django

unread,
Nov 28, 2011, 3:07:02 AM11/28/11
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: nobody
Type: New feature | Status: reopened
Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Andrey Mitroshin <mit@…>):

* ui_ux: => 0
* easy: => 0


Comment:

In django/core/mail/message.py (Django 1.3.1)
msg['Date'] = formatdate()

There is no localtime=True and emails are sending using UTC
When I correct django/core/mail/message.py to
msg['Date'] = formatdate(localtime=True)

Then emails are being sent with correct Date header (using local time with
timezone)

--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 24, 2016, 12:42:34 PM5/24/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: nobody
Type: New feature | Status: new

Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by mitar):

* cc: mmitar@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:13>

Django

unread,
Jun 2, 2016, 5:03:05 PM6/2/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: nobody
Type: New feature | Status: new
Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by carljm):

* easy: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:14>

Django

unread,
Jun 2, 2016, 5:58:09 PM6/2/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: aisipos
Type: New feature | Status: assigned

Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by aisipos):

* status: new => assigned
* owner: nobody => aisipos


--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:15>

Django

unread,
Jun 2, 2016, 7:16:51 PM6/2/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: aisipos
Type: New feature | Status: assigned
Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by carljm):

I'm not convinced of the value of the refactoring proposed in
https://code.djangoproject.com/ticket/12666#comment:9 -- if someone really
wants some strange handling for the Date header, they can just set the
header themselves, which is likely easier than subclassing `Email` for
this purpose. Exposing the stdlib's `localtime` boolean flag is a simple
change which would be friendlier to those who want a local timezone in
their email headers, especially if it actually does respect the currently
active Django timezone (e.g. `TIME_ZONE` setting). (It's not clear to me
from the above whether it does or not; that deserves clarification.)

--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:16>

Django

unread,
Jun 3, 2016, 10:49:32 AM6/3/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: aisipos
Type: New feature | Status: assigned
Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/6703 PR] with comments for
improvement.

--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:17>

Django

unread,
Jun 4, 2016, 9:56:16 AM6/4/16
to django-...@googlegroups.com
#12666: Setting for sending email using localtime instead of UTC
-----------------------------+------------------------------------
Reporter: net147 | Owner: aisipos
Type: New feature | Status: closed

Component: Core (Mail) | Version: 1.1
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"c3495bb984a6f639e828e568fd333e36b46f270f" c3495bb9]:
{{{
#!CommitTicketReference repository=""
revision="c3495bb984a6f639e828e568fd333e36b46f270f"
Fixed #12666 -- Added EMAIL_USE_LOCALTIME setting.

When EMAIL_USE_LOCALTIME=True, send emails with a Date header
in the local time zone.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/12666#comment:18>

Reply all
Reply to author
Forward
0 new messages