Reputation: 1
How can I get the current time,for example, in 10:45:47 am format using php? can anyone help me by answering the above question? Thanks to all.
Upvotes: 0
Views: 572
Reputation: 163752
date("h:i:s a")
http://php.net/manual/en/function.date.php
Upvotes: 5
Reputation: 61547
$time = time(); $date = date();
$time = time();
$date = date();
Reputation: 382606
You can use the date function like this:
date
echo date('h:i:s a');
See the formatting options for the date function to get more idea about it :)
Upvotes: 2