mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-02-19 04:43:36 +00:00
10 lines
384 B
Rust
10 lines
384 B
Rust
//! Formatting utilities for the explorer
|
|
|
|
/// Format timestamp to human-readable string
|
|
pub fn format_timestamp(timestamp: u64) -> String {
|
|
let seconds = timestamp / 1000;
|
|
let datetime = chrono::DateTime::from_timestamp(seconds as i64, 0)
|
|
.unwrap_or_else(|| chrono::DateTime::from_timestamp(0, 0).unwrap());
|
|
datetime.format("%Y-%m-%d %H:%M:%S UTC").to_string()
|
|
}
|