my ($day,$month,$year,) = split(/-/,$history_tradedate); # Creates the timestamp(often have to write -1 because many date functions # start with 0 for fist month, day etc.) my $history_in_unixtime = timelocal("00","00","00",$day,$month-1,$year);