Capture datetime ajax with jquery

0

I have an array containing some objects from an AJAX call. The values are being passed through a date: " res.data.tags "

In one of the objective answers the following result:

2016-07-15T10:00:00-0300

How do I capture only the "10:00" value of the datetime above?

    
asked by anonymous 16.07.2016 / 01:49

1 answer

1

Use the Moment.js library to convert date / time. Example:

moment('2016-07-15T10:00:00-0300').format('hh:mm');

link

    
16.07.2016 / 02:02