0

I am trying the below sql query.

SELECT TO_UTC_TIMESTAMP_TZ('2022-05-05T18:08:13.311Z') FROM DUAL;

However, the query result is never returned in a month name format.Numeric is returned.

enter image description here

I expect the below format of timestamp to be returned.

05-MAY-22 6:08:13.311000000 PM GMT

Is there any other method of Oracle which should be used to return in the above format?

Karu
  • 61
  • 7
  • A `TIMESTAMP WITH TIME ZONE` is a binary data type composed of (up to) 20 bytes including: century, year-of-century, month, day, hour, minute, second, up to 6 bytes for fractional seconds and 7 bytes for time zone; it is **NOT** stored in a human-readable format. Your **display** format is controlled by SQL Developer (which, in turn, probably uses the `NLS_TIMESTAMP_TZ_FORMAT` session parameter). If you want to get the timestamp to **display** in a specific format then convert it to a string using `TO_CHAR` or edit SQL developer's preferences but you cannot change the format of a timestamp. – MT0 May 09 '22 at 11:24
  • I changed the format on SQL Developer to DD-MON-RRRR fmHH12:fmMI:SSXFF AM TZR. I was able to receive the expected result. – Karu May 09 '22 at 11:38

0 Answers0