MySQL Date formatted query

Source: Internet
Author: User

Select Date_format (create_time, '%y-%m-%d ') from T_user_basic_info


%s, %s  Two-digit second ( 00,01, . . ., 59)   %i  two-bit digital ( 00,01,  . . ., 59)   %H  Two-digit hours,24  hours (00,01, . . ., 23)   %h, %I  two-digit hours,12  hours (01,02, . . ., 12)   %k  Number of hours,24  hours (0,1, . . ., 23)   %l  digital form of hours,12  hours (1, 2,   . ., 12)   %T 24  Hours of time form (h h : m m : s  s)   %r 12  hours of time form (hh:mm:   or hh:mm: )   %p   or p m   %W  the name of each day of the week ( s u n d a y, monday, . . .,  urday)   %a  abbreviation for the name of each day of the week ( Sun, Mon, . . ., )   %d   Two-digit number of days in the month ( 00, 01, . . ., 31)   %e  number representation of days in the month ( 1,  2, . . .,  31)  %D  English suffix indicates the number of days in the month ( 1st, 2nd, 3rd, . . .)   %w  Represents the number of days in a week in numbers ( 0 = s u n d a y, 1=monday, . . .,  6=urday)   %j  Three-digit number of days in the year ( 001, 002, . . ., 366)    % U  Week (0, 1, 52), where sunday  is the first day of the Week   %u  Week (0, 1, 52), Where monday  is the first day of the week   %M  month name (j a n u a r y, february, .  . ., december)   %b  abbreviated month name ( j a n u a r y,  february, . . ., december)   %m  Two-digit month ( 01, 02, .  . ., 12)   %c  number of months ( 1, 2, . . ., 12)    %Y  Four-digit year   %y  two-digit year   %%  direct value "%"


MySQL Date formatted query

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.