Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Web Technology by (19.9k points)

I wonder if it is possible to fetch hours, minutes and seconds from Moment object?

for example:

Moment('12:16','HH:mm').get('minutes') //should result in '16'

I can't find anything like that in documentation though...

1 Answer

0 votes
by (25.1k points)

You can try the following:-

Moment('12:16','HH:mm').minutes();

Or you can use the following option - use format('mm'). It will return '16' in a string format.

Related questions

Browse Categories

...