My current Date format is in MM/YY. I Need to default days to my format in php.
For example:
12/2009 -> 07/12/2009
I tried this code:
$currdate = '07/'.$currdate;
$newFormat = date('d-M-Y',strtotime($currdate));
But the new format is wrong, it output 12/07/2009.
----------------- Edit -----------------------------
I have tried **DateTime::createFromFormat**
.Since my $currdate date format has only month and year its not accepting.I am getting a fatal error.