In-depth understanding of oracle datetime timestamp
We all know that date and timestamp are both expressions of date and time, but the two types of precision are different. The former is accurate to seconds, and the latter is precise to decimal seconds, which can be 0 to 9, the default value is 6. The timestamp function is described in detail. 1. Convert the struct type to timestamp select to_timestamp ('01-August 15, October-07.46.41.000000000 am ', 'dd-MON-yy hh: mi: ss. ff AM ') from dual; 2. Convert timestamp to date type select cast (to_timestamp ('01-August 15, October-07.46.41.000000000 AM', 'dd-MON-yy hh: mi: ss. ff AM ') as date) timestamp_to_date from dual; 3. Convert the date type to timestamp select cast (sysdate as timestamp) date_to_timestamp from dual; 4. Obtain the system time in timestamp format select systimestamp from dual; 5. Subtract the date of two dates The result is the number of days, while the two timestamp dates subtract the complete year, month, day, hour, minute, second decimal second select systimestamp-policimestamp from dual; select sysdate-sysdate from dual; note: timestamp: calculate the number of seconds between the two dates. Use a function to convert them.