Monday, 15 August 2011

php - Change format date -



php - Change format date -

i have date in format "m-y-d". how can modify date format "y-d-m"? best should function can add together old format , new format, how can create it?

for illustration have

$date = '01-2013-13'; // "m-y-d"

i receive:

$newdate = '2013-13-01'; // "y-d-m"

see datetime::createfromformat() , datetime::format()

$date = datetime::createfromformat('m-y-d', '01-2013-13'); echo $date->format('y-m-d');

php date

No comments:

Post a Comment