diff options
| author | mo8it <mo8it@proton.me> | 2024-06-22 13:35:54 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-06-22 13:35:54 +0200 |
| commit | 3d540ed946ee9fd522ba9ec26f68055f5c498317 (patch) | |
| tree | 48bdcf0ef31a3ac79720c386961adb7a430fceea /solutions | |
| parent | 98cd00de6378550985d819ac8cd1227c8a10818e (diff) | |
modules3 solution
Diffstat (limited to 'solutions')
| -rw-r--r-- | solutions/10_modules/modules3.rs | 9 |
1 files changed, 8 insertions, 1 deletions
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!"), + } +} |
