diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-27 10:42:27 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-27 10:42:27 -0500 |
| commit | 4abf853ebed9608583a39b13ab3cd3f14ecd1f4b (patch) | |
| tree | 2ce9ca80401d59e2bb7bab1b229ce79d0292cc25 /rustlings/solutions/10_modules/modules3.rs | |
| parent | 5457f377967b3fc910d98c138b988c58f6462aa5 (diff) | |
rustlings: complete 10
Diffstat (limited to 'rustlings/solutions/10_modules/modules3.rs')
| -rw-r--r-- | rustlings/solutions/10_modules/modules3.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rustlings/solutions/10_modules/modules3.rs b/rustlings/solutions/10_modules/modules3.rs index dcf2377..99ff5a7 100644 --- a/rustlings/solutions/10_modules/modules3.rs +++ b/rustlings/solutions/10_modules/modules3.rs @@ -1,4 +1,8 @@ +use std::time::{SystemTime, UNIX_EPOCH}; + fn main() { - // DON'T EDIT THIS SOLUTION FILE! - // It will be automatically filled after you finish the exercise. + 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!"), + } } |