... } # I could use: $stime = ($datetemp[3] * 360) + ($datetemp[4] * 60) # <-- convert to seconds ...