> > 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 ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org