converting zdump output to rule (timezones, DST)

I'm searching for method of converting Solaris timezone rules returned by "zdump" to little different rule containg something like "last Sunday" or "first Sunday".

For example "zdump" will return for Poland for 2007:

# zdump -v Poland|grep 2007

Poland Sun Mar 25 00:59:59 2007 UTC = Sun Mar 25 01:59:59 2007 CET isdst=0

Poland Sun Mar 25 01:00:00 2007 UTC = Sun Mar 25 03:00:00 2007 CEST isdst=1

Poland Sun Oct 28 00:59:59 2007 UTC = Sun Oct 28 02:59:59 2007 CEST isdst=1

Poland Sun Oct 28 01:00:00 2007 UTC = Sun Oct 28 02:00:00 2007 CET isdst=0

and I'd like to get the rule similar to:

MarlastSun 1:00u

OctlastSun 1:00u

Is there some tool in Solaris or some C++ function that would return such output or translate it to that format?

Thanks,

Jarek

[829 byte] By [jarekch] at [2007-11-26 11:20:13]
# 1

It's not the same format, but you could look at the source for the zone.

# more /usr/share/lib/zoneinfo/src/europe

[snip]

ZoneEurope/Warsaw1:24:00 -LMT1880

1:24:00 -WMT1915 Aug 5# Warsaw Mean Time

1:00C-EurCE%sT1918 Sep 16 3:00

2:00Poland EE%sT1922 Jun

1:00Poland CE%sT1940 Jun 23 2:00

1:00C-EurCE%sT1944 Oct

1:00Poland CE%sT1977

1:00W-EurCE%sT1988

1:00EUCE%sT

[...]

So Warsaw is the same as EU time, and....

[...]

# Rule NAMEFROMTOTYPEINONATSAVELETTER/S

RuleEU19771980-AprSun>=11:00u 1:00S

RuleEU1977only-SeplastSun 1:00u 0-

RuleEU1978only-Oct11:00u 0-

RuleEU19791995-SeplastSun 1:00u 0-

RuleEU1981max-MarlastSun 1:00u 1:00S

RuleEU1996max-OctlastSun 1:00u 0-

[...]

So that gives the details as it being the last Sunday.

I suppose a program could do the reverse of 'zic' taking the zonefile and creating some type of text representation of the rules, but I'm unaware of one. Google did find reference to an 'unzic', but it was part of a UnixWare update.

--

Darren

Darren_Dunham at 2007-7-7 3:35:36 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...