I have a html form that sends a date, I set this to a variable within the php and it is outputted in this format: 01/01/2000. Edit I can't change the format in which I receive the date-it's a pre-set html file.
I need to use this variable for a SQL query on a database that dates format is like this 2000-01-01. So how can I change this format and assign it to a new variable?
So
$dateOne = $_REQUEST["date_1"];
#Outputs 01/01/2000
I would like 2000-01-01.
I've read a lot on here about doing this but can only manage to get 1970-01-01 by using date('Y-m-d', strtotime($dateOne));
which I think is being reset due to strtotime
?
Very new to this so sorry if I have overlooked something very simple.