I need to add a number of minutes to a variable which stores a datetime stamp in the following format DDMMYYYY HH:MM:SS. Currently I am converting the time into a julian time, add the number of minutes(see below). However this method only works if a day has 24 hours. During Daylight saving a day could have either 23 or 25 hours. Therefore this will not work. What is the best way to get round this.
my $julian_time = timelocal(substr(@ARGV[0],15,2),substr(@ARGV[0],12,2),substr(@ARGV[0],9,2),substr(@ARGV[0],6,2),substr(@ARGV[0],4,2)-1,substr(@ARGV[0],0,4))
;
$julian_time+=(@ARGV[1]*60);
my @tmstmp = localtime($julian_time);
my $julian_time = timelocal(substr(@ARGV[0],15,2),substr(@ARGV[0],12,2),substr(@ARGV[0],9,2),substr(@ARGV[0],6,2),substr(@ARGV[0],4,2)-1,substr(@ARGV[0],0,4))
;
$julian_time+=(@ARGV[1]*60);
my @tmstmp = localtime($julian_time);