474 views
# chrono/chrono-tz conversions *[*]: `DateTime<T>` *[Naive]: `NaiveDateTime` *[Utc]: `DateTime<Utc>` *[Tz]: `DateTime<chrono_tz::Tz>` | From | To | | |-------|-------------|-------------------------------------| | * | Naive local | `<from>.naive_local()` | | * | Naive UTC | `<from>.naive_utc()` | | Naive | Utc | `Utc.from_utc_datetime(<from>)` | | Naive | Tz | `<tz>.from_local_datetime(<from>)?` | | Tz | Utc | `<from>.with_timezone(&Utc)` | | Utc | Tz | `<from>.with_timezone(&<tz>)` | ## Parsing | From | To | | | ---------------------- | ----- | - | | Unix timestamp (`i64`) | Naive | `NaiveDateTime::from_timestamp(secs, millis)` |