Mysql oracle Time Operation example

Source: Internet
Author: User

Mysql oracle Time Operation example select alarmid, alarmtype, dttimestamp from hdralarmbase20130320 where dttimestamp> to_date ('2017-3-20 10:12:28 ', 'yyyy-mm-dd hh24: mi: ss') Similar usage of mysql SELECT alarmid, alarmtype, dttimestamp FROM hdralarmbase20130129 WHERE dttimestamp <STR_TO_DATE ('2017-01-29 13:33:19 ', '% Y-% m-% d % t') date_format (date,' % Y-% m-% D') --------------> to_char (); str_to_date (date, '% Y -% M-% D') --------------> to_date () in oracle; usage in mysql: str_to_date ('2017-05-01 23:59:59 ', '% Y-% m-% d % t') % Y: indicates the 4-digit year % y: indicates the year of 2.% m: indicates the month. The format is (01 ...... 12) % c: represents the month, in the format of (1 ...... 12) % d: represents the number of days in the month, in the format of (00 ...... 31) % e: represents the number of days in the month, in the format of (0 ...... 31) % H: represents the hour, in the format of (00 ...... 23) % k: represents the hour, in the format of (0 ...... 23) % h: represents the hour, in the format of (01 ...... 12) % I: represents the hour, in the format of (01 ...... 12) % l: represents the hour, in the format of (1 ...... 12) % I: represents the minute, in the format of (00 ...... 59) % 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) % S: Second. Format: (00 ...... 59) % s: represents the second, in the format of (00 ...... 59)

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.