make test_time and test_date generic