Re: Convert TimeStamp to Date

From: "Claudio Lapidus" <clapidus(at)hotmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Cc: "Ron Johnson" <ron(dot)l(dot)johnson(at)cox(dot)net>, <shuai(at)objectwareinc(dot)com>
Subject: Re: Convert TimeStamp to Date
Date: 2003-07-23 19:28:56
Message-ID: BAY7-DAV10oPiFEW6sS0000c646@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

> template1=# insert into t values ('1993-08-10 17:48:41');
> INSERT 16980 1
So we are talking about August 10th, right?

> template1=# select f1, date(f1), f1::date, cast(f1 as date) from t;
> f1 | date | f1 | f1
> ---------------------+------------+------------+------------
> 1993-08-10 17:48:41 | 1993-08-11 | 1993-08-11 | 1993-08-11
> (1 row)
Here all casts give Aug. 11th, same as on my 7.3.2 (tested right now). This
is one day *more* than expected, not 'the previous date' as the original
poster said. Perhaps some sort of rounding here?

cl.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dmitry Tkach 2003-07-23 20:52:54 Re: [GENERAL] Convert TimeStamp to Date
Previous Message Ron Johnson 2003-07-23 19:01:38 Re: Convert TimeStamp to Date

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sell 2003-07-23 19:51:08 Join Problem
Previous Message Ron Johnson 2003-07-23 19:01:38 Re: Convert TimeStamp to Date