php date format yyyy-MM-dd HH:mm:ss code example Example: php date format dd/mm/yyyy date("d/m/Y", strtotime($str));