Testing and returning date and time correctly