Re: Convert TimeStamp to Date - Mailing list pgsql-general

From Ron Johnson
Subject Re: Convert TimeStamp to Date
Date
Msg-id 1058998621.20765.33.camel@haggis
Whole thread Raw
In response to Re: Convert TimeStamp to Date  ("Claudio Lapidus" <clapidus@hotmail.com>)
Responses Re: Convert TimeStamp to Date
List pgsql-general
On Wed, 2003-07-23 at 14:28, Claudio Lapidus wrote:
> > 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?

I didn't even notice that.  I wonder what version Patrick Welche
is running?

tree=# select date('1993-08-10 17:48:41.074');
    date
------------
 10-08-1993
(1 row)

"Many eyes make all bugs shallow"

--
+-----------------------------------------------------------------+
| Ron Johnson, Jr.        Home: ron.l.johnson@cox.net             |
| Jefferson, LA  USA                                              |
|                                                                 |
| "I'm not a vegetarian because I love animals, I'm a vegetarian  |
|  because I hate vegetables!"                                    |
|    unknown                                                      |
+-----------------------------------------------------------------+



pgsql-general by date:

Previous
From: "Chris Travers"
Date:
Subject: Re: Role Models Wanted
Next
From: Dmitry Tkach
Date:
Subject: Re: Convert TimeStamp to Date