-
-
Save RandyMcMillan/9da201eb28ce79813c3aa7442ab3e341 to your computer and use it in GitHub Desktop.
jupiter_opposition.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Required dependencies in Cargo.toml: | |
| // [dependencies] | |
| // chrono = "0.4" | |
| use chrono::{TimeZone, Utc}; | |
| fn main() { | |
| // Jupiter Opposition 2011-10-29 01:34:00 UTC | |
| let datetime = Utc.with_ymd_and_hms(2011, 10, 29, 1, 34, 0).unwrap(); | |
| let unix_timestamp = datetime.timestamp(); | |
| println!("Event: Jupiter Opposition (2011)"); | |
| println!("UTC Date/Time: {}", datetime.to_rfc3339()); | |
| println!("Unix Epoch Timestamp: {}", unix_timestamp); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=4c7aa05327e5e2937079a4a82daa4009