The following articles mainly focus on the processing of common time in Oracle databases. The processing of common time in Oracle databases is often used in practical applications. The following articles are the solutions to actual problems, the following is a description of the specific solution. I hope it will help you in your future study.
4824 hours for HH24
- select to_char(sysdate,'yyyy-MM-dd HH24:mi:ss') from dual;
- select to_date('2005-01-01 13:14:20','yyyy-MM-dd HH24:mi:ss') from dual;
- to_date() function
1. Description of date format parameters
D. day of the week
The name of DAY, which is filled with spaces to 9 characters.
Day of DD month
The day of the year in DDD
Short Name of DY day
Week of the Year of the iw iso Standard
Four-digit year of the iyyy iso Standard
YYYY four-digit year
Last three digits of YYY, YY, and Y years, two digits, one digit
HH hours, at 12 hours
HH24 hours, in 24 hours
MI score
SS seconds
MM Month
Abbreviated month of Mon
Full name of Month
W the week of the month
The day of the week in WW 1. Date interval operation
Time Processing in Oracle Database: current time minus 7 minutes
- select sysdate,sysdate - interval '7' MINUTE from dual
Current Time minus 7 hours
- select sysdate - interval '7' hour from dual
Current Time minus 7 days
- select sysdate - interval '7' day from dual
Current Time minus July
- select sysdate,sysdate - interval '7' month from dual
Current Time minus 7 years
- select sysdate,sysdate - interval '7' year from dual
Time Interval multiplied by a number
- select sysdate,sysdate - 8 *interval '2' hour from dual
2. Date-to-character operations
- select sysdate,to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') from dual
- select sysdate,to_char(sysdate,'yyyy-mm-dd hh:mi:ss') from dual
- select sysdate,to_char(sysdate,'yyyy-ddd hh:mi:ss') from dual
- select sysdate,to_char(sysdate,'yyyy-mm iw-d hh:mi:ss') from dual
Refer to the oracle database documentation (ORACLE901DOC/SERVER.901/A90125/SQL _ELEMENTS4.HTM #48515)
3. Character-to-date operations
- select to_date('2003-10-17 21:15:37','yyyy-mm-dd hh24:mi:ss') from dual
The usage is similar to that of to_char. The above content is an introduction to the time processing in the Oracle database. I hope you will have some gains.