Oracle second change time

Source: Internet
Author: User

 
SQL:> select numtodsinterval (365, 'second') from dual;
Result: + 000000000 00:06:05. 000000000;
 
SQL:> select SUBSTR (numtodsinterval (365, 'second'),) from dual;
Result: 00: 06: 05;
 
SQL:> select to_char (to_date ('201312', 'ssss'), 'hh24: mi: ss') from dual;
Result: 00: 16: 40;
 
SQL:> select trunc (30682/3600) | 'hour '| to_char (to_date (mod (30682,3600), 'ssss'), 'fmmi "Minute" ss "second "') from dual;
Result: 8 hours, 31 minutes, 22 seconds;
// Note: The above conversions can only be within 24 hours.
 
SQL:> select trunc (3601*24/3600/24) | 'day' | to_char (to_date (mod (3601*24, * 24), 'ssss '), 'fmhh24 "Hour" mi "Minute" ss "second" ') from dual;
Result: 0 minutes 24 seconds, 1 day, 0 hours;



Author sangei

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.