From 3d540ed946ee9fd522ba9ec26f68055f5c498317 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sat, 22 Jun 2024 13:35:54 +0200 Subject: modules3 solution --- solutions/10_modules/modules3.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'solutions/10_modules/modules3.rs') diff --git a/solutions/10_modules/modules3.rs b/solutions/10_modules/modules3.rs index 4e18198..99ff5a7 100644 --- a/solutions/10_modules/modules3.rs +++ b/solutions/10_modules/modules3.rs @@ -1 +1,8 @@ -// Solutions will be available before the stable release. Thank you for testing the beta version 🥰 +use std::time::{SystemTime, UNIX_EPOCH}; + +fn main() { + match SystemTime::now().duration_since(UNIX_EPOCH) { + Ok(n) => println!("1970-01-01 00:00:00 UTC was {} seconds ago!", n.as_secs()), + Err(_) => panic!("SystemTime before UNIX EPOCH!"), + } +} -- cgit v1.2.3