Skip to content

Commit

Permalink
Handle lower case timestamp separator (apache#3863)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Mar 14, 2023
1 parent e31aac2 commit 3745b1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arrow-cast/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub fn string_to_datetime<T: TimeZone>(
return Ok(DateTime::from_local(date.and_time(time), offset));
}

if !parser.test(10, b'T') && !parser.test(10, b' ') {
if !parser.test(10, b'T') && !parser.test(10, b't') && !parser.test(10, b' ') {
return Err(err("invalid timestamp separator"));
}

Expand Down Expand Up @@ -1022,6 +1022,9 @@ mod tests {
"2020-09-08T12:00:60.123456+02:00",
"2020-09-08T12:00:60.1234567891234567+02:00",
"2020-09-08T12:00:60.999999999+02:00",
"2020-09-08t12:00:12.12345678+00:00",
"2020-09-08t12:00:12+00:00",
"2020-09-08t12:00:12Z",
];

for case in cases {
Expand Down

0 comments on commit 3745b1d

Please sign in to comment.