0 votes
1 view
in Web Technology by (11.2k 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 (22.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.

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


Categories

...