Created
December 17, 2022 13:42
-
-
Save thebigdatajedi/1a568214485dfb151c2a2a555ff5bc2b to your computer and use it in GitHub Desktop.
One way to do it.
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
static getDateTime(): string { | |
const today = new Date(); | |
const date = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate(); | |
const time = today.getHours() + ':' + today.getMinutes() + ':' + today.getSeconds(); | |
const dateTime = date + ' ' + time; | |
return dateTime; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment