Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] date_part bug?

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: Tim Williams <williams(at)ugsolutions(dot)com>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] date_part bug?
Date: 1998-12-20 09:37:01
Message-ID: l03110700b2a2741852ab@[] (view raw, whole thread or download thread mbox)
Lists: pgsql-general
At 20:00 +0200 on 17/12/98, Tim Williams wrote:

> I see the following results:
> m1|m2
> --+--
>  5| 6
> (1 row)
> Why is date_part giving different results for date and date_time?  Why
> is it wrong for 'date'? Anybody seen this before?

Basically, it's a timezone problem.

When you give bare dates, they give you midnight of that same day. My guess
is that since date does not contain the timezone information contained in
datetime, it somehow forgets daylight saving time in its interpretation
into the internal format or out of it.

What's your timezone? Have you tried changing it to see whether it affects
the result?


Herouth Maoz, Internet developer.
Open University of Israel - Telem project

In response to


pgsql-general by date

Next:From: Kaare RasmussenDate: 1998-12-20 17:57:57
Subject: Some obstacles
Previous:From: Miguel ValeroDate: 1998-12-20 00:20:28
Subject: Problems starting postmaster

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group