Answers for "how to get time php with am/pm"

PHP
2

php time format am pm

$currentDateTime = '08/04/2010 22:15:00';
$newDateTime = date('h:i A', strtotime($currentDateTime));
Posted by: Guest on March-25-2020
1

how to get time php with am/pm

// Use this to get time and date with am and pm without leading 0
$date = date("g:i A");

// output: 1:46 PM
Posted by: Guest on September-23-2021

Browse Popular Code Answers by Language