-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup the dynamic "current epoch" calculation in action
- Loading branch information
1 parent
6c6887b
commit 84ffe17
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const startDate = new Date(1658430005000) | ||
|
||
const diffInMs = new Date() - startDate | ||
const diff = (diffInMs / 1000 / 60 / 60) / 84 | ||
// ( diff in hours ) `- epoch increases every 84 hours | ||
const currentEpoch = Math.floor(diff) | ||
console.log(currentEpoch) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters