The code below...
$date = "02-13-2012";
$start_time = "17:30";
$end_time = "20:00";
$start_timestamp = date("m-d-Y H:i",strtotime($date." ".$start_time));
$end_timestamp = date("m-d-Y H:i",strtotime($date." ".$end_time));
print($start_timestamp);
print($end_timestamp);
Returns...
1969-12-31 19:30:00
1969-12-31 20:30:00
Does anyone have any idea why this is not working correctly?
02-13-2012 17:30 is not a recognized date format. Either use day-month-year or year-month-day order, or custom parse the date format using, for example, DateTime::createFromFormat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With