[Dshield] Various Updates

Kenneth McKinlay km-web at home.com
Thu Aug 9 00:50:03 GMT 2001


The perl script that I "borrowed" to do the timezone determination in 
my scripts is this function:

-----------
# calculate TZ based on gmtime and localtime
# from a UseNet posting by Larry Rosler on February 13, 1999
#
sub tz_offset {
	my $now = time;
	my ($l_min, $l_hour, $l_year, $l_yday) = (localtime $now)[1, 2, 5, 7];
	my ($g_min, $g_hour, $g_year, $g_yday) = (gmtime $now)[1, 2, 5, 7];
	my $tz=($l_min - $g_min)/60 + $l_hour - $g_hour + 24 * ($l_year - $g_year || $l_yday - $g_yday);

	my $return=sprintf "%+03d:%02d",int $tz, ($tz - int $tz) * 60;
	$return;
} 
------------

All I have to do is call it like this:
	$tz=tz_offset();

As far as I know, this should work for figuring out that stupid DST 
issue.

Ken McKinlay
Ottawa, Canada


From:           	"Samuel" <Samuel at socal.rr.com>
To:             	<dshield at dshield.org>
Subject:        	Re: [Dshield] Various Updates
Send reply to:  	dshield at dshield.org
	<mailto:dshield-request at dshield.org?subject=subscribe>
	<mailto:dshield-request at dshield.org?subject=unsubscribe>
Date sent:      	Wed, 8 Aug 2001 16:07:08 -0700

> I think that daylight savings time is confusing. DST seems like such a
> simple thing, yet since (according to the Window registry timezone
> data) GMT recognizes DST, I think that many people would be confused
> about whether to set their TZ variable dependent upon DST.
> 
> For systems using Windows, timezone information is available from the
> operating system. I would be very surprised if Unix is not as
> sophisticated as Windows. I do not understand why we must specify our
> timezone when the operating system probably knows better than many
> (most) of us what to use.
> 
> 
> ----- Original Message -----
> From: "Johannes B. Ullrich" <jullrich at euclidian.com>
> To: <dshield at dshield.org>
> Sent: Wednesday, August 08, 2001 7:39 AM
> Subject: [Dshield] Various Updates
> 
> 
> > [snipped]
> 
> > - Time Sync: There are a lot of new log submitters. Please make sure
> >   your system clocks are in sync. We provide a little tool to help:
> >   The page http://www1.dshield.org/timestamp.php will send a packet
> >   to your computer that should be logged by your firewall. Later,
> >   when you submit the log, it will send you an e-mail indicating the
> >   offset.
> 
> > [snipped]
> 
> 
> _______________________________________________
> Dshield mailing list
> Dshield at dshield.org
> To change your subscription options (or unsubscribe), see:
> http://www1.dshield.org/mailman/listinfo/dshield


 
Kenneth McKinlay
kmckinlay at home.com




More information about the list mailing list