Search code examples
momentjstime-format

Time format in momentjs that has number of day prefix


How can we use momentjs for a time format that has a number of day part prefix? We can use:

moment("19:41:00", "HH:mm:ss");

What is the time format for:

28.19:41:00

Thanks for helping.


Solution

  • let date = this.moment("28.19:41:00", "DD.HH:mm:ss");
    console.log(date.format("YYYY/MM/DD HH:mm:ss"));      // 2019/12/28 19:41:00
    console.log(date.format("HH:mm:ss"));                 // 19:41:00