$file_name = "sms.vmg"; tie my @array, 'Tie::File', $file_name or die("Unable to open file \"$file_name\": $!\n"); my $year = substr $array[13], 22, 8; my $month = substr $array[13], 16, 2; my $date = substr $array[13], 10, 4; my $hour = substr $array[13], 32, 4; my $minutes = substr $array[13], 38, 4; my $seconds = substr $array[13], 44, 4; $dt = DateTime->new( year=>$year, month=>$month, day=>$date, hour=>$hour, minute=>$minutes, second=>$seconds, nanosecond=>0, time_zone => 'Asia/Calcutta'); $epoch_time = $dt->epoch * 1000; print "\nEpoch Time: ".$epoch_time;