Skip to content

Home

Get colon time from date

Returns a string of the form HH:MM:SS from a Date object.

const getColonTimeFromDate = date => date.toTimeString().slice(0, 8);

getColonTimeFromDate(new Date()); // '08:38:00'

More like this

Start typing a keyphrase to see matching snippets.