1.0.0 • Published 3 years ago

harptos-epoch v1.0.0

Weekly downloads
2
License
ISC
Repository
-
Last release
3 years ago

Harptos Epoch

Converts Calendar of Harptos dates to and from an epoch.

Installation

npm install harptos-epoch

Basic Usage

Import module

import { toEpoch, fromEpoch } from 'harptos-epoch';

Convert to Epoch

const year = 1492;
const month = 4;
const day = 15;

const epoch = toEpoch(year, month, day);
// 784884960

Convert from Epoch

const epoch = 784884960;

const { year, month, day } = fromEpoch(epoch);
// year = 1492
// month = 4
// day = 15