Skip to content

Instantly share code, notes, and snippets.

@RandyMcMillan
Forked from rust-play/playground.rs
Last active June 3, 2026 22:29
Show Gist options
  • Select an option

  • Save RandyMcMillan/9da201eb28ce79813c3aa7442ab3e341 to your computer and use it in GitHub Desktop.

Select an option

Save RandyMcMillan/9da201eb28ce79813c3aa7442ab3e341 to your computer and use it in GitHub Desktop.
jupiter_opposition.rs
// 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);
}
@RandyMcMillan

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment