Switched the time functions to use the C standard time structs and functions.