correctly obtains the time