@@ -45,15 +45,9 @@ assert_eq!(record_0, row_0.record);
45
45
let timestamp = prov_ref.timestamp(0).unwrap();
46
46
assert_eq!(timestamp, row_0.timestamp);
47
47
48
- // You can get the `chrono::DateTime` object back from the `String`:
49
-
50
- let dt = chrono::DateTime::parse_from_rfc3339(×tamp).unwrap();
51
-
52
- // You can get specific time types back, too:
48
+ // You can get the `humantime::Timestamp` object back from the `String`:
53
49
use core::str::FromStr;
54
- let dt_utc = chrono::DateTime::<chrono::Utc>::from_str(×tamp).unwrap();
55
- let dt_local = chrono::DateTime::<chrono::Local>::from_str(×tamp).unwrap();
56
- println!("local = {}", dt_local);
50
+ let timestamp_string = humantime::Timestamp::from_str(×tamp).unwrap();
57
51
58
52
// Provenance transfers to the tree sequences
59
53
let treeseq = tables.tree_sequence(tskit::TreeSequenceFlags::BUILD_INDEXES).unwrap();
@@ -77,11 +71,9 @@ let record_0 = prov_ref.record(0).unwrap();
77
71
assert_eq!(record_0, row_0.record);
78
72
let timestamp = prov_ref.timestamp(0).unwrap();
79
73
assert_eq!(timestamp, row_0.timestamp);
80
- let dt = chrono::DateTime::parse_from_rfc3339(×tamp).unwrap();
81
74
use core::str::FromStr;
82
- let dt_utc = chrono::DateTime::<chrono::Utc>::from_str(×tamp).unwrap();
83
- let dt_local = chrono::DateTime::<chrono::Local>::from_str(×tamp).unwrap();
84
- println!("local = {}", dt_local);
75
+ let dt_utc = humantime::Timestamp::from_str(×tamp).unwrap();
76
+ println!("utc = {}", dt_utc);
85
77
```
86
78
87
79
"##
0 commit comments