0

I have a current format HH:mm:ss, but I want to convert it into dd:hh:mm. Is this possible in moment.js?

freeman29
  • 147
  • 2
  • 10
  • Refer the documentation you can figure out it easily – Prasad Apr 12 '16 at 04:53
  • Possible duplicate of [Where can I find documentation on formatting a date in JavaScript?](http://stackoverflow.com/questions/1056728/where-can-i-find-documentation-on-formatting-a-date-in-javascript) – Martin Schneider Apr 12 '16 at 05:14
  • Based on what I'm seeing, I feel like you don't have a date here, you have a duration. Note that moment can handle those as well, but it handles them differently. – Maggie Pint Apr 12 '16 at 14:36

1 Answers1

1

Try this,

var dateTime = new Date("2016-04-12 10:24:36");
dateTime = moment(dateTime).format("DD HH:mm");
Prabhat Sinha
  • 1,500
  • 20
  • 32