UNPKG
@arturwojnar/hermes-postgresql
Version:
latest (1.0.0-alpha.12)
1.0.0-alpha.12
1.0.0-alpha.11
1.0.0-alpha.10
1.0.0-alpha.9
1.0.0-alpha.8
Production-Ready TypeScript Outbox Pattern for PostgreSQL
docs.hermesjs.tech
arturwojnar/hermes
@arturwojnar/hermes-postgresql
/
lib
/
common
/
helpers.js
4 lines
•
256 B
JavaScript
View Raw
1
2
3
4
const
toTimestamp
= (
value
) =>
new
Date
(
Date
.
UTC
(
2000
,
0
,
1
) +
Number
(value /
1000n
));
const
toServerSystemClock
= (
epochMs
) =>
BigInt
(epochMs -
Date
.
UTC
(
2000
,
0
,
1
)) *
1000n
;
export
{ toServerSystemClock, toTimestamp };
//# sourceMappingURL=helpers.js.map