I've a date in this format: Tuesday 11th October, 2016 stored in a php varaible $pastdate
I want to convert this to: 2016-10-11 23:59:59
I'm using this line of code:
$newDate = date("Y-m-d", strtotime($pastDate)).' 23:59:59';
However, the output of $newDate is: 2017-10-17 23:59:59
Can anyone explain why this is happening and how I should better format my code? Thanks in advance.