
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-hhmm
Advanced tools
A simple module for basic HH:mm format time calculations
Install with npm i simple-hhmm
Include with require('simple-hhmm');
createTime(input="00:00")
createTime("04:07");tryCreateTime(input)
strTime(t1)
addTime(t1,t2,overwrite=false)
subTime(t1,t2,overwrite=false)
difTime(t1,t2)
const s_hhmm = require('simple-hhmm');
var test = s_hhmm.createTime("12:35");
var test2 = s_hhmm.tryCreateTime("01:15 AM");
var test3 = s_hhmm.createTime("21:45");
var test4 = s_hhmm.createTime("12:24");
var test5 = s_hhmm.createTime("12:37");
var test6 = s_hhmm.tryCreateTime("12:24 pm");
console.log("Times:\nt1: " + s_hhmm.strTime(test) + "\nt2: " + s_hhmm.strTime(test2) + "\nt3: " + s_hhmm.strTime(test3) + "\nt4: " + s_hhmm.strTime(test4) + "\nt5: " + s_hhmm.strTime(test5));
console.log(s_hhmm.strTime(test) + " plus " + s_hhmm.strTime(test2) + " is " + s_hhmm.strTime(s_hhmm.addTime(test, test2)) + " -> overwrite false");
console.log(s_hhmm.strTime(test5) + " plus " + s_hhmm.strTime(test3) + " is " + s_hhmm.strTime(s_hhmm.addTime(test5, test3, true)) + " -> overwrite true");
console.log(s_hhmm.strTime(test) + " minus " + s_hhmm.strTime(test2) + " is " + s_hhmm.strTime(s_hhmm.subTime(test, test2)) + " -> overwrite false");
console.log(s_hhmm.strTime(test2) + " minus " + s_hhmm.strTime(test) + " is " + s_hhmm.strTime(s_hhmm.subTime(test2, test, true)) + " -> overwrite true");
console.log("Time between " + s_hhmm.strTime(test) + " and " + s_hhmm.strTime(test2) + " is " + s_hhmm.strTime(s_hhmm.difTime(test, test2)));
console.log("Time between " + s_hhmm.strTime(test) + " and " + s_hhmm.strTime(test3) + " is " + s_hhmm.strTime(s_hhmm.difTime(test, test3)));
console.log("Time between " + s_hhmm.strTime(test3) + " and " + s_hhmm.strTime(test2) + " is " + s_hhmm.strTime(s_hhmm.difTime(test3, test2)));
console.log("Time between " + s_hhmm.strTime(test) + " and " + s_hhmm.strTime(test4) + " is " + s_hhmm.strTime(s_hhmm.difTime(test, test4)));
console.log("Time between " + s_hhmm.strTime(test) + " and " + s_hhmm.strTime(test5) + " is " + s_hhmm.strTime(s_hhmm.difTime(test, test5)));
console.log("Time between " + s_hhmm.strTime(test6) + " and " + s_hhmm.strTime(test4) + " is " + s_hhmm.strTime(s_hhmm.difTime(test6, test4)));
Times:
t1: 12:35
t2: 01:15
t3: 21:45
t4: 12:24
t5: 12:37
12:35 plus 01:15 is 13:50 -> overwrite false
12:37 plus 21:45 is 10:22 -> overwrite true
12:35 minus 01:15 is 11:20 -> overwrite false
01:15 minus 12:35 is 12:40 -> overwrite true
Time between 12:35 and 12:40 is 00:05
Time between 12:35 and 21:45 is 09:10
Time between 21:45 and 12:40 is 14:55
Time between 12:35 and 12:24 is 23:49
Time between 12:35 and 10:22 is 21:47
Time between 12:24 and 12:24 is 00:00
FAQs
A simple module for basic HH:mm format time calculations
We found that simple-hhmm 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.