Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
150
rated 0 times [  153] [ 3]  / answers: 1 / hits: 110520  / 10 Years ago, thu, november 6, 2014, 12:00:00

I have a output resulting from a timepicker giving 12 hour format of time.



Eg : 1:45 AM (or) 12:15 PM as **string**


Is there a way to parse this string format to 24 hour using moment js back to date object?


More From » momentjs

 Answers
2

See documentation of moment js parse function



JSFiddle



var dt = moment(12:15 AM, [h:mm A]).format(HH:mm);

[#68892] Tuesday, November 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jimmiejudahm

Total Points: 319
Total Questions: 98
Total Answers: 117

Location: Venezuela
Member since Sat, Apr 24, 2021
3 Years ago
;