I am pulling values from a database that contain military time as 1330 (don’t ask why)
I want to convert the 1330 to 13:30 and then run strtotime to turn 13:30:00 into 1:30pm
I am having writers block as to how I can place a colon : between the 2 and 3 character, in 1330
You can do it using:
But Why are you splitting .You can directly get your output 1:30pm with:
The second option will give you result more faster. Why wasting time splitting.
Hope this helps 🙂