3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-18 23:09:59 +00:00
zeppelin/backend/src/utils/idToTimestamp.ts

11 lines
215 B
TypeScript
Raw Normal View History

import moment from "moment";
const EPOCH = 1420070400000;
export function idToTimestamp(id: string) {
if (typeof id === "number") return null;
return moment(+id / 4194304 + EPOCH)
.utc()
.valueOf();
}