rpecli 0.1.9

Rust cli tool to display information about PE files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use chrono::{DateTime, NaiveDateTime, Utc};

pub fn format_timestamp(timestamp: i64) -> String {
    let naive = NaiveDateTime::from_timestamp_opt(timestamp.into(), 0).unwrap();
    let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc);
    format!(
        "{} (Timestamp: {} ({:#x}))",
        datetime.format("%Y-%m-%d %H:%M:%S"),
        timestamp as i64,
        timestamp as i64,
    )
}