Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> TIMESTAMPTZ byte array
How should I interpret byte array of TIMSTAMPTZ?
I need to format value from timestamptz field using ISO format for XML
'yyyy-MM-dd'T'HH:mm:ss(+/-)TZH:TZM'
I can't figure out how the date is stored in this array and how to use
time zone offset or region id that are stored in bytes 11, 12.
For example in database I have the next value with time zone offset
16-JUN-03 04.19.19 PM -08:00
When I retrieve this value into oracle.sql.TIMESTAMPTZ the array looks
like this
- byteArr byte[13]
[0] 120 byte
[1] 103 byte
[2] 6 byte
[3] 17 byte
[4] 1 byte
[5] 20 byte
[6] 20 byte
[7] 0 byte
[8] 0 byte
[9] 0 byte
[10] 0 byte
[11] 12 byte
[12] 60 byte
- byteArr byte[13]
[0] 119 byte
[1] -57 byte
[2] 10 byte
[3] 31 byte
[4] 9 byte
[5] 31 byte
[6] 1 byte
[7] 0 byte
[8] 0 byte
[9] 0 byte
[10] 0 byte
[11] -119 byte
[12] -100 byte
This is what documentation says:
The internal data for this object is stored as a thirteen byte array in the super class' storage area. The bytes are arranged as follows:
Byte Represents 0 Century (119 for 1990) 1 Decade (190 for 1990) 2 Month 3 Day 4 Hour 5 Minute 6 Seconds 7 Nanoseconds (Most Significant bit) 8 Nanoseconds 9 Nanoseconds 10 Nanoseconds (Least Significant Bit) 11,12 Region id or Timezone Hour/MinuteThe timezone information is stored as an offset in the RegionID format or in the HOUR/MINUTE format
Please help. Received on Fri Oct 31 2003 - 18:23:56 CST
![]() |
![]() |