Coder Social home page Coder Social logo

falieson / js-second Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 95 KB

Tired of repeating common ms and second calculations in most projects? Centralize and harden these ideas with a repo!

JavaScript 63.09% TypeScript 36.91%
utils helpers time seconds milliseconds

js-second's Introduction

@falieson/js-second

Tired of repeating common ms and second calculations throughout your repositories? Let's centralize and harden these ideas with a repo!

Install

$ npm i -S @falieson/js-second
$ yarn @falieson/js-second

Aliases

second - s, sec, seconds

millisecond - ms, msec, milliseconds

imports

get a year amount of seconds

import time from "@falieson/js-second"
console.log(time.second.year) // 31536000
import {second} from "@falieson/js-second"
console.log(second.year) // 31536000

get a year amount of milliseconds

import time from "@falieson/js-second"
console.log(time.millisecond.year) // 31536000000
import {millisecond} from "@falieson/js-second"
console.log(millisecond.year) // 31536000000

Calculations

Alias second millisecond Description
unit 1 1 1 unit of
second 1 1000 1 sec
quarterMinute 15 15000 15 sec
halfMinute 30 30000 30 sec
minute 60 60000 60 sec
doubleMinute 120 120000 2 mins
fiveMinute 300 300000 5 mins
quarterHour 900 900000 15 mins
halfHour 1800 1800000 30 mins
hour 3600 3600000 60 mins
quarterDay 21600 21600000 3 hours
halfDay 43200 43200000 6 hours
day 86400 86400000 24 hours
week 604800 604800000 7 days
doubleWeek 1209600 1209600000 14 days
halfMonth 1296000 1296000000 15 days
month 2592000 2592000000 30 days
quarterYear 7862400 7862400000 91 days
halfYear 15724800 15724800000 182 days
year 31536000 31536000000 365 days

js-second's People

Contributors

falieson avatar juhq avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

juhq

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.