[Thread Prev][Thread Next][Thread Index]
Re: What needs patched to fix this ?
- To: servis@xxxxxxxxxx
- Subject: Re: What needs patched to fix this ?
- From: Casper Dik <casper@xxxxxxxxxxxxxxx>
- Date: Sat, 01 Jan 2000 16:34:32 +0100
- Cc: pilotmgr@xxxxxxxxxxxxxxxxxxxx
- In-reply-to: Your message of "Sat, 01 Jan 2000 10:00:36 EST." <E124Q1J-000182-00@brian.servis.snet>
- Sender: owner-pilotmgr
>*- On 1 Jan, Larry W. Virden wrote about "What needs patched to fix this ?"
>> When I did a PilotManager sync today, I see:
>>
>> 01/01/100 7:39:00 Please press the Hotsync button on your Pilot cradle
>> ^^^
>>
>> I am using version 1.107 of PilotManager
>
>
>This is a perl issue. I don't speak perl but have seen lots of these
>perl date problems discussed on the net over the last 24hrs. Apparently
>one of the perl date functions returns the date as a diff from 1900. So
>the programmer is sloppy. There were lots of places that would just put
>a text string of '19' and then append the date so places where reporting
>the date as 19100. Sorry I don't know where the problem is in the code.
>Just passing on the info.
Not a perl issuem but rather a porgammer issue; the standard unix
time data structure "tm" has a tm_year field that lists "years since 1900";
interestingly, I witnessed the same problem on "swissinfo.net" when it
was past midnight in New Zealand, when I looked at:
http://www.swissinfo.net/cgi/worldtime/clock.pl?Chatham,New=Zealand
A perl CGI script; it was fixed five ours later; see also
http://www.cnn.com/1999/TECH/computing/12/31/y2k.timedate/index.html
But, of course, the mainstream media still don't have a clue about the
technicalities involved in Y2K bugs; there are no usual Y2K bugs either.
(Most of the Solaris Y2K bugs fixed were precisely this bug; and mostly
benign too; (benign in the sense that showing 1/1/100 to humans or on
printouts doesn't break automated systems).
The routine "prettyTime" in PilotMgr.pm (1.107) has the bug:
sub prettyTime
{
my ($time) = @_;
my(@DoW) = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
my(@MoY) = ('Jan','Feb','Mar','Apr','May','Jun',
'Jul','Aug','Sep','Oct','Nov','Dec');
my($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst);
# Determine what time zone is in effect.
# Use GMT if TZ is defined as null, local time if TZ undefined.
# There's no portable way to find the system default timezone.
my($TZ) = defined($ENV{'TZ'}) ? ( $ENV{'TZ'} ? $ENV{'TZ'} : 'GMT' ) : '';
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
($TZ eq 'GMT') ? gmtime($time) : localtime($time);
# Hack to deal with 'PST8PDT' format of TZ
# Note that this can't deal with all the esoteric forms, but it
# does recognize the most common: [:]STDoff[DST[off][,rule]]
if($TZ=~/^([^:\d+\-,]{3,})([+-]?\d{1,2}(:\d{1,2}){0,2})([^\d+\-,]{3,})?/){
$TZ = $isdst ? $4 : $1;
}
$TZ .= ' ' unless $TZ eq '';
$mon++;
return sprintf("%02d/%02d/%02d %2d:%02d:%02d",
$mon, $mday, $year, $hour, $min, $sec);
}
------------------------------------------------------------------------
***********************************************************
* This is a public mailing list! *
* Please do not publish Sun proprietary information here! *
* - - - - - - - - - - - - - - *
* http://www.moshpit.org/pilotmgr *
***********************************************************