Getting Hour and Minute in PHP

Viewed 214934

I need to get the current time, in Hour:Min format can any one help me in this.

8 Answers

You can use the following solution to solve your problem:

echo date('H:i');
<?php
    date_default_timezone_set('Asia/Qatar');
    $DateAndTime = date('m-d-Y h:i:s a', time());  
    echo "<h3>The current date and time are <h3 style='color:B-G'> $DateAndTime.</h3></h3>";
    ?>
    
Related