Updated time functions