Getting Hour and Minute in PHP

前端 未结 7 1291
既然无缘
既然无缘 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:08

    In addressing your comment that you need your current time, and not the system time, you will have to make an adjustment yourself, there are 3600 seconds in an hour (the unit timestamps use), so use that. for example, if your system time was one hour behind:

    $time = date('H:i',time() + 3600);

提交回复
热议问题