Re: More time manipulation..
От | Gregory Seidman |
---|---|
Тема | Re: More time manipulation.. |
Дата | |
Msg-id | 20021118191931.GA11410@cs.brown.edu обсуждение исходный текст |
Ответ на | More time manipulation.. ("Williams, Travis L, NPONS" <tlw@att.com>) |
Ответы |
Re: More time manipulation..
|
Список | pgsql-general |
Williams, Travis L, NPONS sez: } If I do "select Current_Date".. I get something like: } 2002-11-25 } if I do "select Current_Date + interval '7 days'; I get: } 2002-11-25 00:00:00-06 } is there any way to get it to only return the parts I'm passing it } (all I want is the date).. I know I can do date_part and pull out the } individual parts and put it back together.. but it looks like I'm } missing something.. The short answer is to use date_part and like it. The longer answer is that the addition (+) operator is not defined on a date and an interval, but since it is defined on a timestamp and an interval, and a date is castable to a timestamp, PostgreSQL helpfully casts the date to a timestamp, performs the addition, and returns a timestamp. What you are getting back is a timestamp because it's the result of adding an interval to a timestamp. } Thanks, } Travis --Greg
В списке pgsql-general по дате отправления: