Skip to content

Instantly share code, notes, and snippets.

@code-vagabond
Created September 16, 2018 21:14
Show Gist options
  • Save code-vagabond/8c2a2619b4d5a320a26dffe20a8dc45c to your computer and use it in GitHub Desktop.
Save code-vagabond/8c2a2619b4d5a320a26dffe20a8dc45c to your computer and use it in GitHub Desktop.
getTimestamp for firestore
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