Friday, May 29, 2015

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

Hey,

Indeed, the problem comes from the representation on PG,
cause I have only good results (0/30 for the minutes) from
the python function.

I don't get though why it is showing the wrong datetime.
@Avraham: It's not the representation of the timezone offset.
It's a false representation. He is not talking about the *+01*
at the end, but why it is 31 or 1 minute on the datetime.

Correct me if I'm wrong.

On 05/29/2015 08:42 AM, Avraham Serour wrote:
this is not an extra minute, it is a representation of the timezone offset

On Thu, May 28, 2015 at 11:42 PM, Daniel Grace <danwgrace@gmail.com> wrote:
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.

--
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/CAFWa6tJp2CLSSqzkiOMyGysGzxk%3DyhP2OD23toS1FOb43%3D%3D3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--   aRkadeFR

No comments:

Post a Comment