Skip Headers

Oracle® Objects for OLE Developer's Guide
10g Release 1 (10.1)

Part Number B10118-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Master Index
Master Index
Go to Feedback page
Feedback

CreateOraTimeStampTZ Method

See Also

Applies To

OraSession Object

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).
Return Values

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)