Re: Imprecision of DAYS_PER_MONTH - Mailing list pgsql-hackers

From Dann Corbit
Subject Re: Imprecision of DAYS_PER_MONTH
Date
Msg-id D425483C2C5C9F49B5B7A41F8944154757CF3F@postal.corporate.connx.com
Whole thread Raw
In response to Imprecision of DAYS_PER_MONTH  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Imprecision of DAYS_PER_MONTH  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Imprecision of DAYS_PER_MONTH  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-hackers
In round figures:

Since there are 365.2422 days per tropical year, there are 31556926
seconds per year (give or take leap seconds).

Ref:
http://www.grc.nasa.gov/WWW/K-12/Numbers/Math/Mathematical_Thinking/cale
ndar_calculations.htm


So 31557600 seems to be off by quite a bit.

> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers-
> owner@postgresql.org] On Behalf Of Bruce Momjian
> Sent: Thursday, July 21, 2005 1:35 PM
> To: Greg Stark
> Cc: Tino Wildenhain; Tom Lane; PostgreSQL-development; Marc G.
Fournier
> Subject: Re: [HACKERS] Imprecision of DAYS_PER_MONTH
>
> Greg Stark wrote:
> >
> > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >
> > > > > BTW, if you actually wanted to improve readability, defining a
> > > > > SECS_PER_YEAR value and replacing the various occurrences of
> > > > > "36525 * 864" with it would help.
> > > > >
> > > > IIRC the number of seconds in a year is far from a constant.
> > >
> > > Yes, I added a comment mentioning that we don't track leap
seconds.
> > > And this doesn't handle crossing uneven daylight savings time
> intervals.
> >
> > It doesn't even represent leap years, never mind leap seconds.
>
> Good, point, mention added.
>
> --
>   Bruce Momjian                        |  http://candle.pha.pa.us
>   pgman@candle.pha.pa.us               |  (610) 359-1001
>   +  If your life is a hard drive,     |  13 Roberts Road
>   +  Christ can be your backup.        |  Newtown Square, Pennsylvania
> 19073
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Imprecision of DAYS_PER_MONTH
Next
From: Tom Lane
Date:
Subject: Re: [PATCHES] Roles - SET ROLE Updated