1. yyyy-mm-ddhh24: mi: ssYYMMDDHH24: MI: SS: y indicates the last digit of the year yy indicates the last two digits of the year yyy indicates the last three digits of the year yyyy indicates the year with four digits; mm indicates the month with two digits; dd indicates the day of the month; ddd indicates the day of the year; dy indicates the day of the week, such as Friday.
Only common related values are listed. 1. yyyy-mm-dd hh24: mi: ss YY/MM/DD HH24: MI: SS: y indicates the last digit of the year yy indicates the last two digits of the year yyy indicates the last three digits of the year yyyy indicates the year with four digits; mm indicates the month with two digits; dd indicates the day of the month; ddd indicates the day of the year; dy indicates the day of the week, such as Friday.
Only common related items are listed;
1. yyyy-mm-dd hh24: mi: ss YY/MM/DD HH24: MI: SS:
Y indicates the last yy Of The Year. The last two yyy digits of the year indicate the last three yyyy digits of the year;
Mm uses two digits to represent the month; dd indicates the day of the month; ddd indicates the day of the year; dy indicates the day of the week, such as Friday or fri;
Day indicates the day of the week; hh 2-digit indicates 12-digit hour; hh24 2-digit indicates 24-hour;
2-digit mi indicates minute;
Two-digit ss indicates 60 seconds;
Time range in the 24-hour system: 00: 00: 00-23:59:59
Time range in the 12-hour format: 1: 00: 00-12:59:59;
2. Function to_char (sysdate, 'yyyy-mm-dd hh24: mi: ss ')
To_date ('1970-10-29,13: 25: 59', 'yyyy-mm-dd, hh: mi: ss ');
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 '7' hour from dual
3. java operations on Database Date data
Java Date data type. Generally, there are two types: java. util. Date 2. java. SQL. Date;
Use java. SQL. Date to store the data in the database and then read it to "day ";
Use java. util. Date to store data in the database, and the value is accurate to "seconds ";
To be accurate to milliseconds, only strings can be saved. ORACLE databases can only be accurate to seconds instead of milliseconds;