npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

darian-system

v1.1.2

Published

Martian time converter

Downloads

56

Readme

Darian System

This is module for Node.js to convert Earth time to Martian time in Darian system.

The Darian calendar is a proposed system of time-keeping on the planet Mars. It was created by aerospace engineer and political scientist Thomas Gangale in 1985. In 2002 he adopted the Telescopic Epoch, which is in 1609 in recognition of Johannes Kepler's use of Tycho Brahe's observations of Mars to elucidate the laws of planetary motion, and also Galileo Galilei's first observations of Mars with a telescope.

Usage

Clone repository to you node_modules folder or install using npm:

npm install darian-system
var ds = require('darian-system');

Class constructor can receive Date() object or date as arguments in syntax:

new Darian_Date(year[, month[, day[, hour[, min[, sec[, timeZoneModifier]]]]]])

timeZoneModifier for UTC+3 — 3, UTC-5 — -5 If the constructor receives an empty argument string, it will create an object for the current time.

var marsTime = new ds.Darian_Date();
console.log(marsTime.getDate());  // Sol Martis, 17 Mesha 217, 17:18:57

Methods of Darian_Date() object

  • .getDate()

Return date in format [dayOfWeek], [monthDay] [Month] [Year], [Hour]:[Min]:[Sec]

.getDate()  // Sol Mercurii, 04 Gemini 217, 03:42:40
  • .getJSON()

Return date as object like:

{
    dispThisSol: [value],             // Events on this sol
    dispThisDay: [value],             // Events on this day
    mYear: [value],                   // Mars year
    mMonth: [value],                  // Mars month number
    mMonthName: [value],              // Mars month name
    mDay: [value],                    // Mars day in month
    mJulianDay: [value],              // Julian Date
    mNumDay: [value],                 // Sol since beginning of the year
    mSolName: [value],                // Name of sol of the week
    mSolarLongitude: [value],         // Solar Longitude(degrees)
    mHour: [value],                   // Hours
    mMin: [value],                    // Minutes
    mSec: [value]                     // Seconds
}
  • .getDispThisSol()

Return events that occurred on this day of the sol(Mars year).

.getDispThisSol()  // On this sol in 197: Contact with Viking Orbiter 1 was lost after 1,469 sols in Mars orbit.
  • .getDispThisDay()

Return events that occurred on this day of the Earth year.

.getDispThisDay()  // On this day in 1999: Mars Polar Lander was launched.

Functions

  • convMarsToEarth()

Converts Martian Time to Earth Time. Receive Darian_Date() object or Darian_Date().getJSON() and returns Date() object of Earth Time.

var earthTime = ds.convMarsToEarth(marsTime);
console.log(earthTime);  // Wed Feb 07 2018 18:31:26 GMT+0300 (+03)

Credits

Based on Martian Date Calculator — Online converter developed by Alan Hensel and Thomas Gangale.