
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Get the time difference between two date strings or two time strings.
Pendel: German word for pendulum.
Version 3.0 allows you to pass in fully-qualified datetime strings to both
pendel.date() and pendel.time(). Per the v2.0 API, you can still pass in 12-hour
and 24-hour clocktime strings to pendel.time().
$ npm install --save pendel
const duration = require('pendel');
// Difference in CLOCK TIMES via pendel.time()
duration.time('2:00PM', '5:30PM');
duration.time('14:00', '17:30');
duration.time('Mon Jan 01 2001 14:00:00 GMT+0000 (WET)', 'Mon Jan 01 2001 17:30:00 GMT+0000 (WET)');
/*
{
hours: 3,
minutes: 30,
seconds: 0,
totalSeconds: 12600,
totalMinutes: 210
}
*/
// Difference in CALENDAR DATES via pendel.date()
duration.date('Mon Jan 01 2001 00:00:00 GMT+0000 (WET)', 'Thu, 03 Jan 2002 00:00:00 GMT');
duration.date('01/01/01', '01/03/02');
/*
{ years: 1,
months: 12,
weeks: 52,
days: 367,
hours: 8808,
minutes: 528480,
seconds: 31708800
}
*/
pendel.time(startTime, endTime)Get the time difference between startTime and endTime.
Returns an object with the following time properties:
| Property | Description |
|---|---|
hours | The difference in hours |
minutes | The difference in minutes |
seconds | The difference in seconds |
totalSeconds | The total elapsed time in seconds |
totalMinutes | The total elapsed time in minutes |
Type: string
A datestring or clocktime string.
Type: string
A datestring or clocktime string.
Note: startTime & endTime recognize any of the following formats
to be 12-hour or 24-hour clocktime string:
12-hour formats: (space after time optional)
1:00 AM1:00AM1:00:00 AM1:00:00AM24-hour formats:
00:0000:00:00pendel.date(startDate, endDate)Get the elapsed (delta) time between startDate and endDate
Returns an object with the following Date properties:
| Property | Description |
|---|---|
years | The difference in years |
months | The difference in months |
weeks | The difference in weeks |
days | The total elapsed time in days |
hours | The total elapsed time in hours |
minutes | The total elapsed time in minutes |
seconds | The total elapsed time in seconds |
Type: string | Date
The datestring or Date object you want to use as the start date.
Type: string | Date
The datestring or Date object you want to use as the end date.
MIT @ Michael Wuergler
FAQs
Get the time difference between two date strings or two time strings.
The npm package pendel receives a total of 10 weekly downloads. As such, pendel popularity was classified as not popular.
We found that pendel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.