A NPM package that exports functions to convert miliseconds to timestring ( hh:mm:ss ) and convert timestring to milliseconds.
npm install @nisarg99/timeconvertion-js
A NPM package that exports functions to convert miliseconds to timestring ( hh:mm:ss ) & convert timestring to milliseconds.
TimeConversion-Js requires Node.js v4+ to run.
Install the dependencies and devDependencies and start the server.
``sh`
$ npm install @nisarg99/timeconvertion-js
Convert Microseconds to timestring
`javascript
var timeConversion = require('@nisarg99/timeconvertion-js')
var ms = '23456733' // microseconds which you want to convert
var timeString = timeConversion.ConvertMstoTimeString(ms)
console.log(timeString)
`
Convert Seconds to timestring
`javascript`
var timeConversion = require('@nisarg99/timeconvertion-js')
var seconds = "23457" // seconds which you want to convert
var timeString = timeConversion.ConvertSecondstoTimeString(seconds)
console.log(timeString)
Convert timestring to Microseconds
`javascript`
var timeConversion = require('@nisarg99/timeconvertion-js')
// options for timestring are ex. "09:45:56" , "36:07", "43"
var timeString = "09:45:56" // timestring which converts to milliseconds
var microSeconds = timeConversion.ConvertTimeStringtoMs(timeString)
console.log(microSeconds)
Cpnvert timestring to Seconds
`javascript`
var timeConversion = require('@nisarg99/timeconvertion-js')
// options for timestring are ex. "09:45:56" , "36:07", "43"
var timeString = "06:24:32" // timestring which converts to seconds
var seconds = timeConversion.ConvertTimeStringtoSeconds(timeString)
console.log(seconds)
#### Tests :
Tests are using mocha, to run the tests use:
`sh``
$ npm test
#### Found a Issue :
Please tell us here
#### Want to contribute? Great!
License
----
MIT
Free Software, Hell Yeah!
[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen. Thanks SO - http://stackoverflow.com/questions/4823468/store-comments-in-markdown-syntax)
[dill]:
[git-repo-url]:
[john gruber]:
[df1]:
[markdown-it]:
[Ace Editor]:
[node.js]:
[Twitter Bootstrap]:
[jQuery]:
[@tjholowaychuk]:
[express]:
[AngularJS]:
[Gulp]:
[PlDb]:
[PlGh]:
[PlGd]:
[PlOd]:
[PlMe]:
[PlGa]: