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

Re: Recent glibc time_t redefinition?

On Mon, Feb 03, 2003 at 01:02:18PM -0600, Steve Greenland wrote:
> On 03-Feb-03, 07:37 (CST), Richard Braakman <dark@xs4all.nl> wrote: 
> > On Mon, Feb 03, 2003 at 12:13:28PM +1000, Andrew Pollock wrote:
> > > I'm assuming it was deliberate also, to address the 2038 bug. I've seen 
> > > much talk of it back in 2000 in Google, but nothing more recent.
> > 
> > Hmm, do I understand correctly that we've introduced a 1970 bug in
> > order to move the 2038 bug to 2106?
> I don't think you call it "introducing a bug"; code that expected the
> standard Unix time functions to work with dates before 01/01/1970 has
> always been broken.

But it doesn't change the fact that glibc has now changed and made
previously working systems fail.

> > A far better strategy would be to start implementing RFC 2550
> > ("Y10K and Beyond") as soon as possible.  Then we'd be permanently
> > rid of these problems.
> Dream on. Yes, that's what we should be doing, but that doing so will
> cause people to do things correctly is being hopelessly optimistic.
> After all, pre-1970 dates have *never* been correct, have *always* been
> documented as incorrect, but enforcing this somehow caused problems with
> the supposedly portable postgresql? (I'm stressing *portable* here;
> I know that there are systems with a different epoch, and different
> representations of time_t.)

Postgresql does do it's own date/time manipulations. What it doesn't do is
store daylight savings information, it uses the underlying system for that.
So now postgresql no longer has daylight savings information for any date
before 1970. Whether this matters depends on your application. You see,
postgresql ignores the return value of mktime, it just uses the daylight
savings and timezone flags.

The silly thing is, glibc still stores the info in it's tables, it's just no
longer accessable through mktime.

Seems to me somebody needs to make a libtime and move all the daylight
savings and timezone stuff there, give it a nice interface and then
everybody who needs accurate info can use that instead of relying on the
OS (and mktime) to get it right.
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Support bacteria! They're the only culture some people have.

Attachment: pgpdi5GO7gzoH.pgp
Description: PGP signature

Reply to: