You can also do this `$scope.time.setHours (hours + 12) % 24`