Created
September 16, 2018 21:14
-
-
Save code-vagabond/8c2a2619b4d5a320a26dffe20a8dc45c to your computer and use it in GitHub Desktop.
getTimestamp for firestore
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
getTimeStamp() { | |
const now = new Date(); | |
now.setUTCHours(now.getUTCHours() + 2); | |
const date = | |
now.getUTCFullYear() + | |
'/' + | |
(now.getUTCMonth() + 1) + | |
'/' + | |
now.getUTCDate(); | |
const time = | |
now.getUTCHours() + | |
':' + | |
now.getUTCMinutes() + | |
':' + | |
now.getUTCSeconds(); | |
return date + ' ' + time; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment