Fixed logic in script dealing with 24 hour conversion