| От | Thomas Lockhart |
|---|---|
| Тема | Re: Timestamp/Interval proposals: Part 2 |
| Дата | |
| Msg-id | 3D05F9AF.C40BFFFD@pgsql.com обсуждение исходный текст |
| Ответ на | Timestamp/Interval proposals: Part 2 (Josh Berkus <josh@agliodbs.com>) |
| Список | pgsql-hackers |
> > fduch=> SELECT to_char('100days'::interval, 'YYYY-MM-DD HH24:MI:SS');
> > ---------------------
> > 0000-00-10 00:00:00
> I already said it. The to_char() is 'tm' struct interpreter and use
> standard internal PG routines for interval to 'tm' conversion. We can
> talk about why 100days is converted to '10' days and months aren't
> used. I agree this example seems strange. Thomas?
Not sure why 100 is becoming 10, except that the formatting string is
specifying a field width of two characters (right?). And for intervals,
years and months are not interchangable with days so values do not
overflow from days to months fields.
I played around with to_char(interval,text) but don't understand the
behavior either.
- Thomas
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера