0

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.

1

3 Answers 3

5
date("h:i:s a")

http://php.net/manual/en/function.date.php

Sign up to request clarification or add additional context in comments.

Comments

2

You can use the date function like this:

echo date('h:i:s a');

See the formatting options for the date function to get more idea about it :)

Comments

0

$time = time();
$date = date();

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.