Getting Started

Build Status

Package Managers

npm: npm install convert.js

bower: bower install convert.js

convert

Utility methods to convert between various date formats.

isoToMilli

Convert iso formatted date to milliseconds since epoch.

Function
isoToMilli(isoString)

Parameters

Name Type Description
isoString string ISO formatted date string.
convert.isoToMilli('1970-01-01T00:00:00.000Z')
// 0

milliToIso

Convert milliseconds since epoch to iso formatted date.

Function
milliToIso(milliseconds)

Parameters

Name Type Description
milliseconds integer,string milliseconds since epoch.
convert.milliToIso(0)
// '1970-01-01T00:00:00.000Z'

Test

All dependencies must be installed (npm install)

Run: npm test

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Also, please don't edit files in the "dist" subdirectory as they are generated via Grunt. You'll find source code in the "src" subdirectory!

License

The MIT License (MIT) Copyright (c) Jarid Margolin <jaridmargolin@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.