Getting Hour and Minute in PHP

前端 未结 7 1313
既然无缘
既然无缘 2020-12-05 09:43

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

7条回答
  •  孤街浪徒
    2020-12-05 10:04

    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.

提交回复
热议问题