Quote:
How to convert 24 hours to 12 hours what pattern or format in php
It is formatting more than a convert.
-First you need to store the value in a variable of type
DateTime
-Then it is a matter of formatting when you output the value.
This is exactly what is doing the 2 lines of code in solution 1.