For now, I post my date like this:
17:34:14.965
I would only have the hours and minutes. How to do ?
you can do in this way
var date="17:34:14.965";
var splittedString=date.split(":");
date=splittedString.slice(0,-1).join(':');
reference split , slice, join
Replace with a regular expression will do the job:
var dateString = '17:34:14.965'
console.log( dateString.replace(/:[^:]*$/,'') );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With