zoneinfo question?

zoneinfo question?

Post by M. K » Thu, 09 Oct 2003 16:15:53


How do I query a zoneinfo file to find out when daylight savings begins
and ends for a particular timezone?
 
 
 

zoneinfo question?

Post by per » Mon, 13 Oct 2003 19:36:59

In article < XXXX@XXXXX.COM > "M. K."
< XXXX@XXXXX.COM > writes:

I don't think you can do that in any "direct" way. Simplest is probably
to read the relevant source file in /usr/src/share/zoneinfo. To do it
programmatically would probably require a binary search a la:

% date +%s
1065954317
% env TZ=Australia/Sydney date -r `expr 0 '*' 86400 + 1065954317`
Sun Oct 12 20:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 40 '*' 86400 + 1065954317`
Fri Nov 21 21:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 20 '*' 86400 + 1065954317`
Sat Nov 1 21:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 10 '*' 86400 + 1065954317`
Wed Oct 22 20:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 15 '*' 86400 + 1065954317`
Mon Oct 27 21:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 13 '*' 86400 + 1065954317`
Sat Oct 25 20:25:17 EST 2003
% env TZ=Australia/Sydney date -r `expr 14 '*' 86400 + 1065954317`
Sun Oct 26 21:25:17 EST 2003

More steps required if you also need the hour...

--Per Hedeland
XXXX@XXXXX.COM

 
 
 

zoneinfo question?

Post by dave0 » Tue, 14 Oct 2003 01:29:28


man 8 zdump

$ /usr/sbin/zdump -v "GB" | grep "2004"
GB Sun Mar 28 00:59:59 2004 UTC =\
Sun Mar 28 00:59:59 2004 GMT isdst=0 gmtoff=0
GB Sun Mar 28 01:00:00 2004 UTC =\
Sun Mar 28 02:00:00 2004 BST isdst=1 gmtoff=3600
GB Sun Oct 31 00:59:59 2004 UTC =\
Sun Oct 31 01:59:59 2004 BST isdst=1 gmtoff=3600
GB Sun Oct 31 01:00:00 2004 UTC =\
Sun Oct 31 01:00:00 2004 GMT isdst=0 gmtoff=0

(Lines broken by me at '\'.)

--
dave.
 
 
 

zoneinfo question?

Post by mark » Thu, 16 Oct 2003 13:52:49


You can also use zdump.

e.g.
zdump -v Australia/Sydney
 
 
 

zoneinfo question?

Post by M. K » Mon, 20 Oct 2003 12:14:31


zdump -v [timezone] | grep "[year] UTC"