Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> TIMESTAMPTZ byte array

TIMESTAMPTZ byte array

From: Andrew <ABryndin_at_retailpro.com>
Date: 31 Oct 2003 16:23:56 -0800
Message-ID: <2bfebe60.0310311623.e42c690@posting.google.com>


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

For another value with time zone identifier 31-OCT-99 01.30.00 AM US/PACIFIC
the byte array looks like this
- 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/Minute         
The 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US