I want to make a webpage that displays the current time. When the \"12-hour format\" button is clicked, the time in 12-hour time will display in the div area. When the \"24-hour
The 12 hour format can be obtained by using moment js a good library for performing time & date operations.
moment().format('YYYY-MM-DD, hh:mm:ss A')
where Post or ante meridiem (Note the only one of the character a p are also considered valid)
Link for Moment Js :-
https://momentjs.com