timestamp get string from mysql hour 2 digit code example Example: mysql extract day from date leading zero DATE_FORMAT(field_name,'%Y-%m-%d')