Created
April 7, 2022 08:53
-
-
Save upupming/773c0a72a0d50338366d2161410a1986 to your computer and use it in GitHub Desktop.
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 characters
const date = new Date() | |
const YYYY = date.getFullYear() | |
const MM = String(date.getMonth() + 1).padStart(2, '0') | |
const dd = String(date.getDate() + 1).padStart(2, '0') | |
const hh = String(date.getHours() + 1).padStart(2, '0') | |
const mm = String(date.getMinutes() + 1).padStart(2, '0') | |
const ss = String(date.getSeconds() + 1).padStart(2, '0') | |
const timestamp = [YYYY, MM, dd, hh, mm, ss].join('-') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment