helper function for getting time strings