There are times when the requirements of the system are recorded in milliseconds (millisecond), and we are going to write the values in db, but if we want to use SQL to do time-range searches, there are a few things to do with the following
( Systemdate linked Fields bit holds system.currenttimemillis () value obtained)
--Find mytable systemdate bit in 2006/11/28 14:00:00 ~ 14:10:00 Information
Select * from myTable where
Systemdate >= (to_date (' 20061128 14:00:00 ', ' YYYYMMDD hh24:mi : SS ')-To_date (' 19700101 8:00:00 ', ' YYYYMMDD hh24:mi:ss ')) *1000*60*60*24
and Systemdate <= (to_date (' 20061128 14:10:00 ', ' YYYYMMDD hh24:mi:ss ')-to_date (' 19700101 8:00:00 ', ' YYYYMMDD hh24:mi:ss ')) *1000*60*60*24
--Find out the time of the lowest date in the MyTable data table Select To_date ( ' 19700101 8:00:00 ' , ' YYYYMMDD hh24:mi:ss ' ) + ((select min (systemdate) from myTable)/1000/60/60/24) the from dual
is processed in Oracle with SQL to System.currenttimemillis