javascript conver time into 24 hour format
var dt = moment("12:15 AM", ["h:mm A"]).format("HH:mm");
javascript conver time into 24 hour format
var dt = moment("12:15 AM", ["h:mm A"]).format("HH:mm");
convert 12 hour format to 24 hour format in javascript
const convertTime12to24 = (time12h) => {
const [time, modifier] = time12h.split(' ');
let [hours, minutes] = time.split(':');
if (hours === '12') {
hours = '00';
}
if (modifier === 'PM') {
hours = parseInt(hours, 10) + 12;
}
return `${hours}:${minutes}`;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us