MCPcopy Create free account
hub / github.com/ccusage/ccusage / format_date_tz

Function format_date_tz

rust/crates/ccusage/src/date_utils.rs:227–238  ·  view source on GitHub ↗
(timestamp: TimestampMs, timezone: Option<&JiffTimeZone>)

Source from the content-addressed store, hash-verified

225}
226
227pub(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
240pub(crate) fn format_utc_date(timestamp: TimestampMs) -> String {
241 let parts = timestamp.utc_parts();

Callers 15

format_dateFunction · 0.85
event_to_loadedFunction · 0.85
to_loaded_entryFunction · 0.85
message_value_to_entryFunction · 0.85
usage_entry_to_loadedFunction · 0.85
message_value_to_entryFunction · 0.85
to_loaded_entryFunction · 0.85
parse_ledger_eventsFunction · 0.85
parse_message_usageFunction · 0.85
row_to_entryFunction · 0.85
to_loaded_entryFunction · 0.85
parse_lineFunction · 0.85

Calls 3

format_utc_dateFunction · 0.85
format_date_partsFunction · 0.85
as_millisMethod · 0.80

Tested by

no test coverage detected