From 5f93b68b4ed69bd675db34284be788b4951caee5 Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Mon, 28 Mar 2022 23:17:32 +0100 Subject: [PATCH] Display datetime metadata in qp-rake1 --- quickpeep_raker/src/bin/qp-rake1.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/quickpeep_raker/src/bin/qp-rake1.rs b/quickpeep_raker/src/bin/qp-rake1.rs index e609408..06bbeef 100644 --- a/quickpeep_raker/src/bin/qp-rake1.rs +++ b/quickpeep_raker/src/bin/qp-rake1.rs @@ -1,5 +1,6 @@ use adblock::lists::RuleTypes; use anyhow::Context; +use chrono::{TimeZone, Utc}; use clap::Parser; use colour::{blue, blue_ln, cyan_ln, green_ln, red_ln, yellow_ln}; use env_logger::Env; @@ -104,6 +105,15 @@ pub async fn main() -> anyhow::Result<()> { if !head.icon.is_empty() { println!("Icon: {}", head.icon); } + match head.datetime { + None => { + println!("Datetime: Unknown"); + } + Some(datetime_unix) => { + let datetime = Utc.timestamp(datetime_unix, 0); + println!("Datetime: {}", datetime.format("%Y-%m-%d %H:%M:%S")); + } + } println!(); print_references(&page.referrer_entry.references);