In a lot of cases where Oracle SQL developers implement a timestamp option in the application they make use of the systdate function from within the Oracle database which returns the current time and date based upon the operating system clock of the operating system the Oracle database is running on.
There is however a more precise way of getting the exact date and time which is using the current_timestamp function from the datbase.
For example if you do;
select current_timestamp(1) from dual;
you wil get
10-NOV-12 02.20.30.600000000 PM US/PACIFIC
and if you do;
select current_timestamp(3) from dual;
you wil get
10-NOV-12 02.20.30.615000000 PM US/PACIFIC
As you can see the provided precision in influencing the the number of milliseconds that is used in your timestamp. Depending on the nature of your application and the accuracy that is needed for the timestamping this can be very important and worth looking into.
No comments:
Post a Comment