MCPcopy Create free account
hub / github.com/mscdex/ssh2 / toUnixTimestamp

Function toUnixTimestamp

lib/protocol/SFTP.js:2514–2521  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

2512}
2513
2514function toUnixTimestamp(time) {
2515 // eslint-disable-next-line no-self-compare
2516 if (typeof time === 'number' && time === time) // Valid, non-NaN number
2517 return time;
2518 if (isDate(time))
2519 return parseInt(time.getTime() / 1000, 10);
2520 throw new Error(`Cannot parse time: ${time}`);
2521}
2522
2523function modeNum(mode) {
2524 // eslint-disable-next-line no-self-compare

Callers 3

futimesMethod · 0.85
utimesMethod · 0.85
attrsToBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…