convert military time to standard time javascript

Solutions on MaxInterview for convert military time to standard time javascript by the best coders in the world

showing results for - "convert military time to standard time javascript"
Alexander
21 Jun 2016
1function convert(input) {
2    return moment(input, 'HH:mm:ss').format('h:mm:ss A');
3}
4
5console.log(convert('20:00:00'));
6console.log(convert('08:00:00'));
7console.log(convert('16:30:00'));
Lennard
19 Mar 2016
1<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.js"></script>