How to get AM/PM from a datetime in PHP

Viewed 277787

I have a date time in a variable. My format is 08/04/2010 22:15:00. I want to display this like 10.15 PM. How to do this in PHP?

12 Answers

Perfect answer for AM/PM live time solution

<?php echo date('h:i A', time())?>

Just simply right A

{{ date('h:i A', strtotime($varname->created_at))}}
Related