convert dates correctly in 12/24h format