Converting separate month, day and year values into a timestamp

前端 未结 7 955
不知归路
不知归路 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条回答
  •  萌比男神i
    2021-02-12 17:22

    why convert string to date when you already know year month and date.

    use setDate funtion

    setDate(2001, 2, 3);
    echo $date->format('Y-m-d');
    ?>
    

提交回复
热议问题