bdo-clock

1.0.5 • Public • Published

bdo-clock

A JavaScript Library to convert real time into Black Desert Online in game clock.

Install

npm install bdo-clock --save

Usage

const bdoClock = require('bdo-clock');
 
console.log(`Current in game time is ${bdoClock()}`);

Custom Date

This library uses moment.js, so it takes any parameter take moment() can take.

bdoClock('2018-06-08T20:20Z').toString(); // "7:00 a.m."

Find out Day/Night Time

bdoClock('2018-06-08T20:20Z').isDaytime; // true

Find next time day change to night or vice versa

bdoClock('2018-06-08T20:20Z').nextDayNightChange.toISOString(); // "2018-06-08T23:40:00.000Z"

Find out time elapsed since 0 a.m. in game

See moment.Durations on how to use the returned duration object

bdoClock('2018-06-08T20:20Z').timeElapsed.hours(); // 7

License

bdo-clock is freely distributable under the terms of the MIT license.

/bdo-clock/

    Package Sidebar

    Install

    npm i bdo-clock

    Weekly Downloads

    10

    Version

    1.0.5

    License

    MIT

    Unpacked Size

    42.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • ruocaled