I have a script to post-process a data file that contains multiple timestamps in GMT. This script is to convert the timestamps from GMT to specific timezone equivalent.
My logic is to convert the timestamp to epoch seconds, determine the seconds difference between GMT and local time, subtract this from the epoch seconds, and convert this back to a local timestamp.
The problem I am seeing is that in trying to get the difference between GMT & local time the returned epoch second are the same.
Here is my sub-routine to get the difference.
$ltime = timelocal($sec,$min,$hour,$mday,$mon,$year);
$gtime = timegm($sec,$min,$hour,$mday,$mon,$year);
$rv = $gtime - $ltime;