Skip to content

Instantly share code, notes, and snippets.

@vitalybe
Created July 9, 2019 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vitalybe/bced231d551ee6ffd425f04c8935e553 to your computer and use it in GitHub Desktop.
Save vitalybe/bced231d551ee6ffd425f04c8935e553 to your computer and use it in GitHub Desktop.
function formatDate(date) {
const hour = date.getHours();
const minute = date.getMinutes();
const second = date.getSeconds();
return (`${hour}:${minute}:${second}`);
}
const prettyDate = useMemo(() => formatDate(currentDate), [currentDate]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment