0 votes
1 view
in Web Technology by (19.4k 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:-


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

Related questions

Welcome to Intellipaat Community. Get your technical queries answered by top developers !