add rtrim to process date string, and add test cases for leading/trailing spaces and invalid microseconds
remove castAsTimestamp in the ValueFactory