Thursday, May 28, 2015

Re: Why the extra minute in PostgreSQL when using time zone info?

I used this function, seemed to tidy up the problem:

from datetime import datetime
from pytz import timezone

    def utcDtTm(self, dt_tm):
        tz = timezone('Europe/London')
        return tz.normalize(tz.localize(dt_tm)).astimezone(timezone('UTC'))

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/12a0ab90-8108-46b4-8e90-5aadedbb3d2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment