I have a bit of a problem. I work for an ISP and have had to develop an 'newbie' perl script to parse copyright infringement letters sent to me in xml and msg. I have a good script, and it works well with the exception of time zones. In my larger script (attached to this post - too large to paste it all), I have the time stamp parsed out of either xml or mime into a variable called '$rawtime' that comes from $array[$i][1]. $rawtime data looks like this:

All values regardless of original time zone should be converted to the appropriate CST/CDT time dependent on CDT dates. I've thought about having the script pull the system time zone. That way, I wouldn't have to compensate for it within the conversion.

Unfortunately, I cannot control what they give me. There might be any number of variable way that they send the time.

Then inspect the $tz value and based on it calculate the needed offset. If the value contains a 'z' then the offset will be -5. Otherwise adjust your default offset by the absolute value of $tz and use that to adjust the timestamp.

This works to get the data as an interger I can work with. So now I have my system time zone ($systemTZ) and the offending info time stamp ($offendingTZ).

What I would like to do is configure a $deltaTZ so that I can rewrite the variable $hour by the difference.

For example... When $systemTZ is -5 and $offendingTZ is 0, I need to adjust the variable $hour -5 hours to convert ZULU time to the local time zone of the box. Likewise, if the $systemTZ is -5 and $offendingTZ is -4, I need to adjust the variable $hour -1 hour to convert EST to local time.

I am having a hard time trying to understand how an absolute value will help here, or did I go off on a tangent from what you suggested?

{EDIT} Actually, that won't work (modifying the variable $hour) because what happens when the time is around midnight, and the $date variable will need to change as well. Best bet is to take the variables ($offendingTZ and $systemTZ) and do a time zone conversion. However, I am having a hard time finding a script that doesn't use the actual names "I.E. CST".