@stdlib/time-base
v0.2.2
Published
Base (i.e., lower-level) time utilities.
Downloads
9
Readme
Base Time
Base (i.e., lower-level) time utilities.
Installation
npm install @stdlib/time-base
Usage
var time = require( '@stdlib/time-base' );
time
Namespace containing "base" (i.e., lower-level) time utilities.
var ns = time;
// returns {...}
The namespace has the following utilities:
parseDuration
: parse a duration string into an object.
Examples
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/time-base' );
console.log( objectKeys( ns ) );
// Parse a duration string
var obj = ns.parseDuration( '1m3s10ms' );
// returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 10 }
obj = ns.parseDuration( '1m3s' );
// returns { 'days': 0, 'hours': 0, 'minutes': 1, 'seconds': 3, 'milliseconds': 0 }
Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2024. The Stdlib Authors.