I’m getting data in the form of date and time:
Monday Jan 23 10:14:27 2024
How in Javascript using .replace to remove everything except time without seconds:
10:14
.
Please tell me, because I am already lost in these regular expressions.
Thank you all.
>Solution :
const reg = /\d{2}:\d{2}/
const str = 'Monday Jan 23 10:14:27 2024'
const time = str.match(reg)[0]
console.log(time)