@tdb/util
Version:
Shared helpers and utilities.
17 lines (16 loc) • 417 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var libs_1 = require("../../libs");
function toTimestamp(date) {
return libs_1.moment(date || new Date())
.utc()
.unix();
}
exports.toTimestamp = toTimestamp;
function fromTimestamp(timestamp) {
return libs_1.moment
.unix(timestamp)
.utc()
.toDate();
}
exports.fromTimestamp = fromTimestamp;