Skip to content

Handling Non-Earth Times (e.g. Mars Time) #2391

Closed

Description

@larkin

I'm currently using moment for time handling in a project and one of our common tasks is converting times from UTC to Mars Solar Time and back again effortlessly. At first I had thought that defining a moment timezone would handle this tidily, but it's not just a fixed offset-- days are longer on mars: 24h 37m 22.663s. The other thing is that typically, Mars missions are recorded in sols (martian solar days) from a fixed date (typically when the mission landed on Mars). So Sol 1 would be the solar day the mission landed on Mars. We can call this time (for any specific mission), Mars Mission Time. Per mission, a UTC time can be provided that corresponds to the start of Sol 1.

I was trying to figure out how I could extend moment to allow UTC -> Mars Solar Time -> Mars Mission Time conversions, and the reverse as well. Similarly, I'd like to be able to use moment.format to format dates in Mars Mission Time but I'm afraid it would not handle the extra 37 minutes in the day correctly (would it?)

It looks like I might be able to achieve this with a custom timezone but I'm not sure how that will handle the longer duration of martian days. Any pointers you can give me for where to start implementing this would be much appreciated.

Some background information: http://en.wikipedia.org/wiki/Timekeeping_on_Mars

If this isn't the right venue for a question like this, please let me know where I should direct it.

Activity

  1. mattjohnsonpint commented on May 28, 2015

    @mattjohnsonpint
    Contributor

    Moment does allow for plugins, which are usually just additional JavaScript functions that take moment as a dependency. However, I'm pretty sure changing the length of a day would be quite difficult.

    You might also refer to the NASA page about Martian time using the Mars24 clock, which divides the Martian solar day into 24 "Martian hours", consisting of 60 "Martian minutes", each with 60 "Martian seconds" - essentially redefining the second to no longer approximate the SI second. This would certainly be challenging for moment.

    Closing due to it being out of scope. But good luck!

  2. mattjohnsonpint commented on May 28, 2015

    @mattjohnsonpint
    Contributor

    Also - time zones would not help with this. Time zones will adjust a local time by a offset from UTC, but they will not allow for the timekeeping system to be changed from UTC to TAI, UT1, or Martian time. :)

  3. mattjohnsonpint commented on May 28, 2015

    @mattjohnsonpint
    Contributor
  4. OmarIthawi commented on Feb 13, 2018

    @OmarIthawi

    So, this isn't a joke and Mars timing is actually being requested 🤦‍♂️?

  5. Shinigami92 commented on Jul 31, 2019

    @Shinigami92

    http://junior-senior689.blogspot.com/2009/08

    ... On Mars we are allowed to drink alcohol at the age of 11 (martian) years ...

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions