MySQL date and characters convert each other

Source: Internet
Author: User

From:http://www.2cto.com/database/201303/195083.html

MySQL date and character are converted Date_format (date, '%y-%m-%d ')--------------To_char () in >oracle;   Str_to_date (date, '%y-%m-%d ')--------------to_date () in >oracle; Www.2cto.com%Y: Represents a 4-digit year%Y: Represents the year of 2 for%m: Represents the month, in the format (01 ... %c: Represents the month in the format (1 ...). %d: Represents the number of days in the month in the format (00 ...). %e: Represents the number of days in the month, in the format (0 ...). %H: Represents the hour, in the form of (00 ... %k: Represents the hour in the format of (0 ...). %h: Represents the hour in the format of (01 ...). %I: Represents the hour, in the format (01 ...). %l: Represents the hour, in the format (1 ...). %i: Represents minutes in the format of (00 ... %r: Represents the time, in the format of 12 hours (Hh:mm:ss [ap]m)%T: Represents the time, in the format of 24 hours (HH:MM:SS)

MySQL date and characters convert each other

Related Article

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.