Skip to content

A Rust-based utility for calculating and displaying Martian time.

License

Notifications You must be signed in to change notification settings

integrityofstellar/mars-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mars Clock

A Rust-based utility for calculating and displaying Martian time. Demo Image: Mars Clock

Description

This project provides a tool to convert Earth time to Mars time, including the calculation of Airy Mean Time (AMT) and Solar Longitude (Ls). It features both a one-time display and a real-time updating clock for Mars time.

As we do not have different timezones on Mars yet, the Mars Clock uses a single timezone for the entire planet. The time is displayed in Airy Mean Time (AMT), which is the Mars equivalent of Greenwich Mean Time on Earth, and is based on the Mars Sol (sol = Martian day) length of 88775.244 seconds.

Accuracy

While developer is not an expert - provided utility provides output same as following resources:

Features

  • Convert Earth time to Mars time
  • Calculate Airy Mean Time (AMT)
  • Calculate Mars Solar Longitude (Ls)
  • Display current Mars time
  • Real-time updating Mars clock

Installation

Download the latest release file from the releases page and put it somewhere on your computer where you can easily access it. Then, you can run the Mars Clock from the command line using this file, or you can add it to your PATH, .bashrc or .zshrc to run it from anywhere.

Current build is done on Intel based MacOS, and works perfectly on it. If you have a different system, you can build the project manually, as I haven't tested it yet.

Manual Installation

  1. Ensure you have Rust installed on your system. If not, you can install it from https://www.rust-lang.org/.

  2. Clone this repository:

git clone https://github.com/integrityofstellar/mars-clock.git
cd mars-clock
  1. Build the project:
cargo build --release

Executable files will be located in the target/release directory.

Usage

Get the current Mars time:

mars-clock

Get the real-time updating Mars clock:

mars-clock --real-time

How It Works

The Mars Clock uses the following key concepts:

  • Julian Date conversion
  • Mars sol length (88775.244 seconds)
  • Mars epoch (J2000)
  • Calculation of Mars Solar Longitude

The time is displayed in Airy Mean Time (AMT), which is the Mars equivalent of Greenwich Mean Time on Earth.

Contributing

Contributions to improve the Mars Clock are welcome. Please feel free to submit a Pull Request.

License

This project is open source and available under the MIT License.

Acknowledgments

  • This project was inspired by the need for accurate Martian timekeeping in space exploration and Mars-related research.
  • Special thanks to the Rust community for providing excellent tools and libraries.
  • Thanks to NASA and Wikipedia for providing valuable data on Mars timekeeping.