New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

time-util

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-util

Lightweight date and time utilities, to avoid the weight of momentjs

latest
Source
npmnpm
Version
2.0.5
Version published
Maintainers
1
Created
Source

time-util

Contains date and time utilities that are not found in moment.js

Date and Time Utilities

var timeutil = require('time-util');

var d0 = new Date();
console.log( "Date is %s", dateutil.toISOLocaleString(d0);

The method toISOLocaleString extends the Date object.

var d0 = new Date();
console.log( d.toLocaleString() );       // Existing Date object method
console.log( d.toISOString() );          // Existing Date object method
console.log( d.toISOLocaleString() );
console.log( d.toISOLocaleString(true) );
console.log( timeutil.formatMS(d) );

Resultant output:

5/1/2016, 11:49:21 AM
2016-05-01T18:49:21.122Z
2016-05-01T11:49:21.122-07:00
2016-05-01T11:49:21-07:00
406146:49:21.122
// Run
console.log(timeutil.formatMS(3454));
console.log(timeutil.formatMS(32397843));
console.log(timeutil.formatMS(130054));
console.log(timeutil.formatMS(41234));

// Resultant output
3.454
8:59:57.843
2:10.054
41.234

Keywords

localize

FAQs

Package last updated on 03 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts