0

I want to convert the below date which is ISO 8601 Zulu time format .

2022-05-05T18:08:13.311Z

to the below Oracle timestamp with timezone data type

05-MAY-22 06.08.13.311 +00:00

Is there any functions or methods we can make use of in Javascript to achieve this?

Karu
  • 61
  • 7
  • 1
    What is the purpose of the conversion, i.e., how with the converted date value be used? Also, the Oracle timestamp format shown in the question doesn't appear to match the [Oracle documentation](https://docs.oracle.com/cd/B19306_01/server.102/b14225/ch4datetime.htm#i1006081). – Yogi May 09 '22 at 08:30
  • I have changed the format. I am converting this to oracle timestamp format as that data type won't be able to hold the iso format. – Karu May 09 '22 at 08:50
  • 2
    Oracle timestamps don't have any intrinsic human-readable format. If you're ultimately sending the JS string value to the database then you can leave it in ISO format and convert it on the database side with `to_timestamp_tz()` with a matching format mask (or possibly`to_utc_timestamp_tz()`). – Alex Poole May 09 '22 at 08:52
  • 3
    In Oracle, a `TIMESTAMP` is a binary data type that is **NEVER** stored in any particular human-readable format (it is stored in 20 bytes representing century, year-of-century, month, day, hour, minute, second, 6 bytes for fractional seconds and 7 bytes for time zone information). What you see is the default format used by the client application to **display** the binary data received from the database and this display format bears no relation to the binary format used by the database for storage. – MT0 May 09 '22 at 08:58

0 Answers0