diff options
Diffstat (limited to 'solutions/10_modules')
| -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!"), + } +} |
