Re: timestamps and dates - Mailing list pgsql-general

From Antti Haapala
Subject Re: timestamps and dates
Date
Msg-id Pine.GSO.4.44.0304291027420.1101-100000@paju.oulu.fi
Whole thread Raw
In response to Re: timestamps and dates  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
Responses Re: timestamps and dates  (Antti Haapala <antti.haapala@iki.fi>)
List pgsql-general
On Mon, 28 Apr 2003, Nigel J. Andrews wrote:

> On Tue, 29 Apr 2003, Antti Haapala wrote:
>
> > And what comes to leap second accounting, the leap seconds were introduced
> > in 1972 and after that only ~35 leap seconds have been added to UTC.
> >
> > You could try this on your box (it *might* work):
> >
> > % date +%s -d '31-dec-1998 23:59:60'
> > 915141600
> > % date +%s -d '1-jan-1999 00:00:00'
> > 915141600
> >
> > If there's one second difference in numbers it implies that leap second
> > accounting is on in your timezone file.
>
> I'm definitely going to try this out tomorrow during a break.

This works better: The number of seconds from Epoch in POSIX compliant
timezones at even hours is divisible by 3600... :)

% export TZ=Europe/Helsinki
% date +%s -d 00:00:00
1051563600

...while...

% export TZ=right/Europe/Helsinki
% date +%s -d 00:00:00
1051563622

So zones in 'right' folder have leap second support on. The difference is
correct - 22 (i had it wrong before), the number of leap seconds inserted
since UTC Epoch on 1 Jan 1972.


--
Antti Haapala
+358 50 369 3535
ICQ: #177673735


pgsql-general by date:

Previous
From: Jose Manuel Sanchez
Date:
Subject: create gist index
Next
From: Shridhar Daithankar
Date:
Subject: Re: Estimating space required for indexes