Convert 12 hour (AM/PM) string to 24 Date object using moment js

后端 未结 8 1065
轻奢々
轻奢々 2021-02-01 01:26

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 par

8条回答
  •  清歌不尽
    2021-02-01 01:44

    In full calender to show time in 12 hour format like 01:00 PM i used following format - timeFormat: 'hh:mm A'. "timeFormat" is the property of events of fullcalender.

    Same format 'hh:mm A' we can use to format datetime object using momentjs.

提交回复
热议问题