Converts the time `t`, which is assumed to be in UTC, to the timezone `tz`. For example, `EST` and `17:39:14` would return `12:39:14`.
(tz: Timezone, t: NaiveTime, wall_time: &NaiveDateTime)
| 156 | /// Converts the time `t`, which is assumed to be in UTC, to the timezone `tz`. |
| 157 | /// For example, `EST` and `17:39:14` would return `12:39:14`. |
| 158 | pub fn timezone_time(tz: Timezone, t: NaiveTime, wall_time: &NaiveDateTime) -> NaiveTime { |
| 159 | let offset = match tz { |
| 160 | Timezone::FixedOffset(offset) => offset, |
| 161 | Timezone::Tz(tz) => tz.offset_from_utc_datetime(wall_time).fix(), |
| 162 | }; |
| 163 | t + offset |
| 164 | } |
| 165 | |
| 166 | #[derive( |
| 167 | Ord, |
no outgoing calls
no test coverage detected