Created
August 24, 2023 02:24
-
-
Save phpmaps/3abc2f0514647a05c51ec78744fe18ee to your computer and use it in GitHub Desktop.
Javascript fun string date
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
const stringDate = () => { | |
const d = new Date(); | |
d.setHours(d.getHours() - 8); | |
return `${d.getUTCMonth() + 1}-${d.getUTCDate()}-${d.getUTCFullYear()}-${d.valueOf()}`; | |
} | |
console.log(stringDate()); // "8-23-2023-1692814955203" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment