Re: Convert TimeStamp to Date
От | Ron Johnson |
---|---|
Тема | Re: Convert TimeStamp to Date |
Дата | |
Msg-id | 1058998621.20765.33.camel@haggis обсуждение исходный текст |
Ответ на | Re: Convert TimeStamp to Date ("Claudio Lapidus" <clapidus@hotmail.com>) |
Ответы |
Re: Convert TimeStamp to Date
|
Список | 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 по дате отправления: