gets time correctly