https://github.com/ai/darian
Darian Mars calendar converter
https://github.com/ai/darian
Last synced: 9 months ago
JSON representation
Darian Mars calendar converter
- Host: GitHub
- URL: https://github.com/ai/darian
- Owner: ai
- License: mit
- Created: 2012-05-16T11:21:56.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2014-12-18T12:49:32.000Z (over 11 years ago)
- Last Synced: 2024-11-24T17:54:33.802Z (over 1 year ago)
- Language: Ruby
- Size: 181 KB
- Stars: 25
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
Awesome Lists containing this project
README
# Darian Mars Calendar Converter [](https://travis-ci.org/ai/darian)
This is Ruby library to convert Earth time to Mars time in Darian calendar.
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. This library use 2002 version of calendar with Telescopic Epoch
(1609 instead of 1975 year in original calendar propose).
Based on [JS converter] by Thomas Gangale.
[Darian calendar]: http://en.wikipedia.org/wiki/Darian_calendar
[JS converter]: http://pweb.jps.net/~tgangale/mars/converter/calendar_clock.htm
## Usage
```ruby
require 'darian'
earth_time = Time.now
mars_time = Darian.from_earth(earth_time)
mars_time.to_s #=> "214-09-17 15:07:17"
mars_time.year #=> 214
mars_time.month #=> 9
mars_time.sol #=> 17
mars_time.day #=> 17
mars_time.month_name #=> "Aries"
mars_time.week_sol_name #=> "Sol Martis"
earth_date = Date.today
mars_date = Darian.from_earth(earth_date)
```