Getting Hour and Minute in PHP

smakstr picture smakstr · Oct 6, 2009 · Viewed 176.6k times · Source

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

Answer

MattBelanger picture MattBelanger · Oct 6, 2009
print date('H:i');
$var = date('H:i');

Should do it, for the current time. Use a lower case h for 12 hour clock instead of 24 hour.

More date time formats listed here.