Saturday, July 30, 2011

How to change date format in php


Here you do the change date format with this function.

Code :
public function todayDDMMMYY($dt,$format='d-M-Y') {
        date_default_timezone_set('Asia/Calcutta');//// Change according itself country Zone
        return date($format,strtotime($dt));
    }