From 667f26bfdb93f70a4f4f62e9d40d4d6970febb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Fri, 20 Nov 2020 15:35:26 +0100 Subject: [PATCH] Fix cargo-deny. (#522) * Fix cargo-deny. * Update time crate. * Fix time issues. --- bridges/relays/utils/src/initialize.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bridges/relays/utils/src/initialize.rs b/bridges/relays/utils/src/initialize.rs index c6c395d18e02..6b0efb49e480 100644 --- a/bridges/relays/utils/src/initialize.rs +++ b/bridges/relays/utils/src/initialize.rs @@ -30,7 +30,9 @@ pub fn initialize_relay() { builder.parse_filters(&filters); builder.format(move |buf, record| { writeln!(buf, "{}", { - let timestamp = time::OffsetDateTime::now_local().format("%Y-%m-%d %H:%M:%S %z"); + let timestamp = time::OffsetDateTime::try_now_local() + .unwrap_or_else(|_| time::OffsetDateTime::now_utc()) + .format("%Y-%m-%d %H:%M:%S %z"); if cfg!(windows) { format!("{} {} {} {}", timestamp, record.level(), record.target(), record.args()) } else {