I currently have a date/time picker that puts the current date and time the user selected into a textbox.
The format is like the following :
22-04-2018 17:34 d-m-Y H:i
I am wondering if there is a way to convert that into a PHP timestamp?
I currently have a date/time picker that puts the current date and time the user selected into a textbox.
The format is like the following :
22-04-2018 17:34 d-m-Y H:i
I am wondering if there is a way to convert that into a PHP timestamp?
As I wrote in comments, the best option is to choose a "Y-m-d" format as that can easily be converted to timestamp with strtotime().
But if you can't do that you can use datetime class to convert it.
$time = "22-04-2018 17:34";
$format = "d-m-Y H:i";
$dt = date_create_from_format ($format , $time);
Echo date_timestamp_get($dt);