Converting separate month, day and year values into a timestamp

前端 未结 7 764
不知归路
不知归路 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

    Use it like this strtotime("YYYY-mm-DD HH:MM AM/PM"):

    echo date("d F Y h:i:s A", strtotime("2011-06-01 11:15 PM")) . "\n";
    

    OUTPUT

    01 June 2011 11:15:00 PM
    
    0 讨论(0)
提交回复
热议问题