Using timestamp I am able to Convert timestamp to actual-time like below. Ie 10:00 AM, and then sending this 10:00 AM to backend now while retrieving this time I need to convert this into timestamp as the component I am using is accepting timestamp only. So how to convert this time 10:00 AM to timestamp? I can put any static date and convert it into timestamp but how to pass this time to timestamp So my actual output 10:00 AM is preserved?
var time = new Date();
console.log(
time.toLocaleString('en-US', {
hour: 'numeric',
minute: 'numeric',
hour12: true
})
);