Search Postgresql Archives

Re: date time function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"John D. Burger" <john@xxxxxxxxx> writes:
> Why do the first and third intervals print out differently?

The underlying storage is months, days, and seconds --- "1 year"
is the same as "12 months", but not the same as "365 days".
IIRC plain timestamp subtraction produces an interval with days and
seconds but the month part is always 0.  You can use justify_days
to convert days to months (at an assumed 30 days/month).  I'm not
sure exactly what age() does but it's probably producing a value
that has nonzero months to start with.

			regards, tom lane


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux