using getdate function which returns date in mm/dd/yyyy format in php code example Example: php date format dd/mm/yyyy date("d/m/Y", strtotime($str));