Strange... Or more likely I don't understand what is going on here, being a noob. Your suggestion about using the epochs helped me at least figure out a way around my problem. If I add:
$oldtime = $oldtime - $ctime->tzoffset;
I get the desired results, although my statement
print "The old time is $oldtime\n";
Then prints a formatted time 6 hours in the future. I needed to update that to
print "The old time is ", $oldtime + $ctime->tzoffset, "\n";
To get it to print the correct time. That isn't a great concern as I actually won't ever be using the print statements, only the calculations, in the bigger script I am retrofitting. Still, it shows I am missing something basic in how this all works and that concerns me. |