feat: add uuid v7 to timestamp converter
This commit is contained in:
parent
3d1d1151bc
commit
358b950af4
1 changed files with 6 additions and 0 deletions
6
utils/uuidToTimestamp.ts
Normal file
6
utils/uuidToTimestamp.ts
Normal file
|
@ -0,0 +1,6 @@
|
|||
export default (uuid: string) => {
|
||||
const parts = uuid.split("-");
|
||||
const bits = parts[0] + parts[1].slice(0, 4);
|
||||
const timestamp = parseInt(bits, 16);
|
||||
return timestamp;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue