Converting separate month, day and year values into a timestamp

前端 未结 7 759
不知归路
不知归路 2021-02-12 16:32

I have a month value (1-12), day value (1-31), and a year value (2010,2011,2012). I also have a hour value and a minute value.

How can I give this to strtotime()

7条回答
  •  天涯浪人
    2021-02-12 17:32

    Is strtotime the best tool for this job? What about mktime()?

    $time = mktime($hour, $minute, 0, $month, $day, $year);
    

提交回复
热议问题