I have a date in Oracle format:
22-JAN 07
And i would like to convert it to something like this:
22/01
The problem is, i can not use the date
function as the string I am trying to convert doesn't match any valid date format.
I was trying it like this:
date('d/m', strtotime($row['BOOKED_DATE_FROM_1']))
But that shows:
01/01
How could i deal with this? Thanks.
Confirmed working
$date = DateTime::createFromFormat('d-M y', '22-JAN 07');
echo $date->format('d/m');
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