Pages

Monday, 25 November 2013

Date format change by php code

For software development we need different types of date format.

We can do it by a simple line of code. There is an example below:
$cdate = '2013-10-25';  // Y-m-d format
$rdate = date("d-m-Y",strtotime($cdate));  // d-m-Y format
echo $rdate;
I think it will help you.

No comments:

Post a Comment