MCPcopy Create free account
hub / github.com/apache/arrow-rs / string_to_timestamp_naive

Function string_to_timestamp_naive

arrow-cast/src/parse.rs:1675–1687  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1673
1674 #[test]
1675 fn string_to_timestamp_naive() {
1676 let cases = [
1677 "2018-11-13T17:11:10.011375885995",
1678 "2030-12-04T17:11:10.123",
1679 "2030-12-04T17:11:10.1234",
1680 "2030-12-04T17:11:10.123456",
1681 ];
1682 for case in cases {
1683 let chrono = NaiveDateTime::parse_from_str(case, "%Y-%m-%dT%H:%M:%S%.f").unwrap();
1684 let custom = string_to_datetime(&Utc, case).unwrap();
1685 assert_eq!(chrono, custom.naive_utc())
1686 }
1687 }
1688
1689 #[test]
1690 fn string_to_timestamp_invalid() {

Callers

nothing calls this directly

Calls 1

string_to_datetimeFunction · 0.85

Tested by

no test coverage detected