n time is repeated, it's called a "fold.") In contrast, an instant in time (that is, `Timestamp` or `Zoned`) can _always_ be converted to a civil datetime. And, when a civil datetime is combined with its time zone identifier _and_ its offset, the resulting machine readable string is unambiguous 100% of the time: ``` use jiff::{civil::date, tz::TimeZone}; let tz = TimeZone::get("America/New_York")?; let dt = date(2024, 11, 3).at(1, 30, 0, 0); // It's ambiguous, so asking for an unambiguous instant presents an error! assert!(tz.to_ambiguous_zoned(dt).unambiguous().is_err()); // Gives you the earlier time in a fold, i.e., before DST ends: assert_eq!( tz.to_ambiguous_zoned(dt).earlier()?.to_string(), "2024-11-03T01:30:00-04:00[America/New_York]", ); // Gives you the later time in a fold, i.e., after DST ends. // Notice the offset change from the previous example! assert_eq!( tz.to_ambiguous_zoned(dt).later()?.to_string(), "2024-11-03T01:30:00-05:00[America/New_York]", ); // "Just give me something reasonable" assert_eq!( tz.to_ambiguous_zoned(dt).compatible()?.to_string(), "2024-11-03T01:30:00-04:00[America/New_York]", ); # Ok::<(), Box>(()) ``` # When should I use civil time? Here is a likely non-exhaustive list of reasons why you might want to use civil time: * When you want or need to deal with calendar and clock units as an intermediate step before and/or after associating it with a time zone. For example, perhaps you need to parse strings like `2000-01-01T00:00:00` from a CSV file that have no time zone or offset information, but the time zone is implied through some out-of-band mechanism. * When time zone is actually irrelevant. For example, a fitness tracking app that reminds you to work-out at 6am local time, regardless of which time zone you're in. * When you need to perform arithmetic that deliberately ignores daylight saving time. * When interacting with legacy systems or systems that specifically do not support time zones.