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

SyncCM behavior due to Solaris localtime bug

I've discovered that a bug in Solaris's localtime() routine causes
perl's timelocal() function to misbehave.  The attached perl script
detects whether you seem to have it or not.  Run it through perl v5
(e.g., "perl checkbug.pl").

Another way to tell is if every time you sync your calendar, the date
range backs up by one day:

08/04/97 10:22:49   Loading Calendar Manager appointments [12/30/1996 to 
08/04/97 10:29:23   Loading Calendar Manager appointments [12/29/1996 to 
08/04/97 10:31:06   Loading Calendar Manager appointments [12/28/1996 to 

I've found that this only affects certain timezones.  The US/* ones
seem to be affected, but ones named like EST5EDT are not.  So, for
US users at least, you can set your TZ environment variable to work
around this bug.  Users in other timezones will have to experiment.

The bugid is 4067374, and is in Solaris 2.6 FCS as well as being 
introduced via the libc patch in 2.5.1 (and maybe others as well).

require 5.000;
use Time::Local;

@tm1 = (0, 0, 0, 1, 0, 97);
$time = timelocal(@tm1);
@tm2 = localtime($time);
if (@tm1[0..5] != @tm2[0..5]) {
    print "You have the bug\n";
    print "Your timezone is $ENV{TZ}\n" if defined $ENV{TZ};
} else {
    print "You don't seem to have the bug\n";

SourceForge.net Logo