Home »
MCQs »
PHP MCQs
Which is the correct PHP statement to print the current time in the format of hour:minutes:seconds(am/pm) i.e., 10:22:54pm?
136. Which is the correct PHP statement to print the current time in the format of hour:minutes:seconds(am/pm) i.e., 10:22:54pm?
- <?php echo date("h:i:sa");?>
- <?php echo date("h:m:sa");?>
- <?php echo date("h:mi:sa");?>
- <?php echo date("hh:min:sa");?>
Answer: A) <?php echo date("h:i:sa");?>
Explanation:
The correct PHP statement to print the current time in the format of hour:minutes:seconds(am/pm) i.e., 10:22:54pm is:
<?php echo date("h:i:sa");?>