Last active
June 19, 2021 11:16
-
-
Save CosmoAbdon/520aac6dabbf078f739d8da57d47bad0 to your computer and use it in GitHub Desktop.
Revisions
-
CosmoAbdon revised this gist
Jun 19, 2021 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,6 @@ export default const timeDiff = (dateNow: number, dateEarlier: number) => { let diffInMS = Math.abs(+dateFuture - (+dateNow)) / 1000; const days = Math.floor(diffInMS / 86400); @@ -23,5 +20,3 @@ const timeDiff = (dateNow: number, dateEarlier: number) => { return {days, minutes, seconds}; } -
CosmoAbdon revised this gist
Jun 19, 2021 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ const { started_at } = await fetchStreamerByUsername(channelName); const started_at_date = new Date(started_at); const date_now = new Date(); const timeDiff = (dateNow: number, dateEarlier: number) => { let diffInMS = Math.abs(+dateFuture - (+dateNow)) / 1000; @@ -23,4 +24,4 @@ const timeDiff = (dateNow: number, dateEarlier: number) => { } console.log(timeDiff(+date_now, +started_at_date)) -
CosmoAbdon revised this gist
Jun 19, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const date_earlier = new Date('18 June 2021 06:15:10 UTC-3'); const date_now = new Date('19 June 2021 07:16:20 UTC-3'); const timeDiff = (dateNow: number, dateEarlier: number) => { let diffInMS = Math.abs(+dateFuture - (+dateNow)) / 1000; const days = Math.floor(diffInMS / 86400); -
CosmoAbdon created this gist
Jun 19, 2021 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ const date_earlier = new Date('18 June 2021 06:15:10 UTC-3'); const date_now = new Date('19 June 2021 07:16:20 UTC-3'); const timeDiff = (dateFuture: number, dateNow: number) => { let diffInMS = Math.abs(+dateFuture - (+dateNow)) / 1000; const days = Math.floor(diffInMS / 86400); diffInMS -= days * 86400; const hours = Math.floor(diffInMS / 3600) % 24; diffInMS -= hours * 3600; const minutes = Math.floor(diffInMS / 60) % 60; diffInMS -= minutes * 60; const seconds = Math.floor(diffInMS) % 60; diffInMS -= seconds * 60; console.log(days, minutes, seconds) return {days, minutes, seconds}; } console.log(timeDiff(+date_now, +date_earlier))