oracle timestamp to date 1

oracle timestamp to date

-- TO_TIMESTAMP(date_string,'YYYY-MM-DD HH24:MI:SS')
SELECT TO_TIMESTAMP('2021-02-21 23:12:01','YYYY-MM-DD HH24:MI:SS') FROM DUAL;

Here is what the above code is Doing:
1. We’re creating a table called “test_table” with a column called “date_string” that is a string.
2. We’re inserting a date string into the table.
3. We’re selecting the date string from the table and converting it to a timestamp.

The output of the above code is:

21-FEB-21 11.12.01.000000000 PM

The output is in the format of “DD-MON-YY HH.MI.SS.FF AM”.

The “FF” is the fractional seconds.

The “AM” is the AM/PM indicator.

The “HH” is the hour in 24-hour format.

The “MI” is the minute.

The “SS” is the second.

The “MON” is the month in letters.

The “YY” is the year in two digits.

The “DD” is the day of the month.

The “PM” is the AM/PM indicator.

The “000000000” is the fractional seconds.

The “11” is the hour in 24-hour format.

The “21” is the day of the month.

The “21” is the year in two digits.

The “FEB” is the month in letters.

The “12” is the minute.

The “01” is the second.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional seconds.

The “.” is the fractional

Similar Posts