maccaj51
asked on
Php changing date format
Hi Experts,
I need to convert the date formatted like this:
Friday 28 October 2011
to
YYYY-MM-DD
Many Thanks
I need to convert the date formatted like this:
Friday 28 October 2011
to
YYYY-MM-DD
Many Thanks
https://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_201-Handling-date-and-time-in-PHP-and-MySQL.html
Date("Y-m-d") is probably what you want, or date('c')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This works. You might want to use date_default_timezone_set( ) depending on where your clients and servers are located.
Best regards, ~Ray
Best regards, ~Ray
<?php // RAY_temp_maccaj.php
error_reporting(E_ALL);
$in = 'Friday 28 October 2011';
echo date('Y-m-d', strtotime($in));
ASKER
Thanks Guys... Sorry Ray I just used the first one... Thank you for your response though