This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Another timezone problem

Here's another timezone related bug report.

------- start of forwarded message (RFC 934 encapsulation) -------
From: Kars de Jong <>
Subject: libc/1056: Zoneinfo problem with Amsterdam
Date: Tue, 30 Mar 1999 14:06:02 +0200 (CEST)

>Number:         1056
>Category:       libc
>Synopsis:       'timezone' variable wrong when timezone is Amsterdam
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    libc-gnats
>State:          open
>Class:          sw-bug
>Submitter-Id:   unknown
>Arrival-Date:   Tue Mar 30 07:10:01 EST 1999
>Originator:     Kars de Jong
  Kars de Jong             Signaalkamp rules the waves!       Turrican@Discworld
  --------======]**-----|      |-----**[======---------
>Release:        libc-2.1
Host type: m68k-unknown-linux-gnu
System: Linux rincewind 2.2.3-pre1 #4 Fri Mar 26 11:17:24 CET 1999 m68k unknown
Architecture: m68k

Addons: crypt linuxthreads

Build CC: egcs
Compiler version: egcs-2.91.66 19990314 (egcs-1.1.2 release)
Kernel headers: 2.2.3-pre1
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: no
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

I am working on porting the Java Development Kit to Linux/m68k and I've come
accross the following problem: the JDK uses the 'timezone' global variable to
determine the offset from GMT. If I use tzselect to set my timezone to
Europe/Amsterdam, the test program below prints this:

daylight : 1, tzname[0] : CET, timezone : -1168, tm_gmtoff : 7200

That offset is very wrong, it should have been -3600.
This not only happens on Linux/m68k, it also happens with Linux/x86.
It doesn't appear to be version specific either, it also happens with
my RedHat glibc-2.0.7.

I used the following test case program:

- ------------------------------------------------------------------------------
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int main() {
  time_t now;
  struct tm *ltime;

  now = time(NULL);
  ltime = localtime(&now);
  printf("daylight : %d, tzname[0] : %s, timezone : %d, tm_gmtoff : %d\n",
	 daylight, tzname[0], timezone, ltime->tm_gmtoff);
  return 0;
- ------------------------------------------------------------------------------
Good question. I've looked at timezone/europe and the definition for Amsterdam looks fine
to me. The line that should be used is the same as Berlin or Paris, which do work.
Another odd thing is that the broken down time structure DOES contain the correct offset
------- end -------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]