@@ -45,15 +45,9 @@ assert_eq!(record_0, row_0.record);
4545let timestamp = prov_ref.timestamp(0).unwrap();
4646assert_eq!(timestamp, row_0.timestamp);
4747
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`:
5349use 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();
5751
5852// Provenance transfers to the tree sequences
5953let treeseq = tables.tree_sequence(tskit::TreeSequenceFlags::BUILD_INDEXES).unwrap();
@@ -77,11 +71,9 @@ let record_0 = prov_ref.record(0).unwrap();
7771assert_eq!(record_0, row_0.record);
7872let timestamp = prov_ref.timestamp(0).unwrap();
7973assert_eq!(timestamp, row_0.timestamp);
80- let dt = chrono::DateTime::parse_from_rfc3339(×tamp).unwrap();
8174use 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);
8577```
8678
8779"##
0 commit comments