(timestamp: TimestampMs, timezone: Option<&JiffTimeZone>)
| 225 | } |
| 226 | |
| 227 | pub(crate) fn format_date_tz(timestamp: TimestampMs, timezone: Option<&JiffTimeZone>) -> String { |
| 228 | let Ok(timestamp) = JiffTimestamp::from_millisecond(timestamp.as_millis()) else { |
| 229 | return format_utc_date(timestamp); |
| 230 | }; |
| 231 | let timezone = timezone.cloned().unwrap_or_else(JiffTimeZone::system); |
| 232 | let zoned = timestamp.to_zoned(timezone); |
| 233 | format_date_parts( |
| 234 | i32::from(zoned.year()), |
| 235 | u32::from(zoned.month() as u8), |
| 236 | u32::from(zoned.day() as u8), |
| 237 | ) |
| 238 | } |
| 239 | |
| 240 | pub(crate) fn format_utc_date(timestamp: TimestampMs) -> String { |
| 241 | let parts = timestamp.utc_parts(); |
no test coverage detected