Re: timestamps and dates

From: Antti Haapala <antti(dot)haapala(at)iki(dot)fi>
To: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: timestamps and dates
Date: 2003-04-29 07:52:41
Message-ID: Pine.GSO.4.44.0304291027420.1101-100000@paju.oulu.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jose Manuel Sanchez 2003-04-29 07:53:26 create gist index
Previous Message Gerhard Hintermayer 2003-04-29 07:26:10 Backend memory leakage when inserting