Menu

gitpiper

getColonTimeFromDate javascript Code Snippet in 2023

datestringbeginner

Last Updated: 4 February 2023

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

  • Use Date.prototype.toTimeString() and String.prototype.slice() to get the HH:MM:SS part of a given Date object.
const getColonTimeFromDate = date => date.toTimeString().slice(0, 8);
getColonTimeFromDate(new Date()); // '08:38:00'

javascript snippet similar to getColonTimeFromDate For You in February 2023

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2023 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️