#26653: Make syndication's lastBuildDate timezone aware
-------------------------------------+-------------------------------------
     Reporter:  didrix               |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.syndication  |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     Keywords:  timezone             |             Triage Stage:  Accepted
  syndication lastBuildDate          |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  1                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by didrix):

 Replying to [comment:1 timgraham]:
 > I guess a patch might look like:
 > {{{ #!diff
 > diff --git a/django/utils/feedgenerator.py
 b/django/utils/feedgenerator.py
 > index 3a91af3..2bbc7b8 100644
 > --- a/django/utils/feedgenerator.py
 > +++ b/django/utils/feedgenerator.py
 > @@ -226,7 +226,7 @@ class SyndicationFeed(object):
 > -        return latest_date or datetime.datetime.now()
 > +        return latest_date or timezone.now()
 > }}}

 Could also do this:

 {{{ #!diff
 diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
 index 3a91af3..2bbc7b8 100644
 --- a/django/utils/feedgenerator.py
 +++ b/django/utils/feedgenerator.py
 @@ -226,7 +226,7 @@ class SyndicationFeed(object):
 -        return latest_date or datetime.datetime.now()
 +        return latest_date or timezone.localtime(timezone.now())
 }}}

 What do you reckon?

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.86c3e2007c4e0e525dad8ae307b90591%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to