Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

timethat

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

timethat

print time from one date to another

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Time That

A simple module to print elapsed time from one date to another.

I use this in several of my CLI tools and figured I should export it and not just copy it.

Install

npm i timethat

Usage

var timethat = require('timethat'),
    start = new Date('1/1/2010 3:00:00'),
    end = new Date('1/1/2010 5:43:21');

console.log(timethat.calc(start, end));

//2 hours, 43 minutes, 21 seconds
var start = new Date('1/1/2010 3:00:00'),
    end = new Date('1/1/2010 3:21:02');

console.log(timethat.calc(start, end));

//21 minutes, 2 seconds
console.log(timethat.calc(1262336400000, 1262336400150));

//0.15 seconds

You can give it seconds or Date objects.

Build Status

Build Status

Currently at 100% code coverage, reports are in the Travis builds.

Keywords

FAQs

Package last updated on 03 Jun 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc