Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
Applies To
Description
The OraSession.CreateOraTimestampTZ method creates a new OraTimeStampTZ object. This OraTimeStampTZ represents an Oracle TIMESTAMP WITH TIME ZONE datatype.
Usage
Set OraTimeStampTZObj = OraSession.CreateOraTimeStampTZ value format
Arguments |
Description |
---|---|
[in] value |
A Variant of type String, Date, or OraTimeStampTZ. |
[in, optional] format |
TIMESTAMP WITH TIME ZONE format string to be used when displaying or interpreting an OraTimeStampTZ as a string. If format is not specified, the TIMESTAMP WITH TIME ZONE string is interpreted using the session TIMESTAMP WITH TIME ZONE format (NLS_TIMESTAMP_TZ_FORMAT format). |
OraTimeStampTZ
Remarks
An OraSession object must be created before an OraTimeStampTZ object can be created.
If value is a Variant of type String, the string format must match the datetime format specified in the format argument if format is specified; otherwise, the string format must match the session TIMESTAMP WITH TIME ZONE format (NLS_TIMESTAMP_TZ_FORMAT).
If value is a Variant of type Date, the date time value in Date is interpreted as the date time value in the session time zone. The TimeZone property in the OraTimeStampTZ object contains the session time zone.
If format is specified, it is stored in the OraTimeStampTZ's Format property; otherwise the session TIMESTAMP WITH TIME ZONE format is stored in the OraTimeStampTZ's Format property.
Example
Dim oraTSZ as OraTimeStampTZ
Dim oraTSZ1 as OraTimeStampTZ
Dim date as Date
'Create an OraTimeStampTZ using a string assuming the session
'TIMESTAMP WITH TIME ZONE format is "DD-MON-RR HH.MI.SSXFF AM
'TZH:TZM"
Set oraTSZ = oo4oSession.CreateOraTimeStampTZ(
"12-JAN-2003 12.0.0.0 PM -03:00")
'Create an OraTimeStampTZ using a string and a format
Set oraTSZ = oo4oSession.CreateOraTimeStampTZ(
"2003-01-12 12:00:00 PM -03:00", "YYYY-MM-DD HH:MI:SS AM TZH:TZM")
'Create an OraTimeStampTZ using a Date
date = #1/12/2003#
Set oraTSZ = oo4oSession.CreateOraTimeStampTZ(date)
'Create an OraTimeStampTZ using an OraTimeStampTZ
Set oraTSZ1 = oo4oSession.CreateOraTimeStampTZ(oraTSZ)