CreateOraTimeStamp Method

Applies To

OraSession Object

Description

Creates a new OraTimeStamp object. This OraTimeStamp method represents an Oracle TIMESTAMP or an Oracle TIMESTAMP WITH LOCAL TIME ZONE data type.

Usage

Set OraTimeStampObj = OraSession.CreateOraTimeStamp value format

Arguments

The arguments for the method are:

Arguments Description
[in] value A Variant of type String, Date, or OraTimeStamp.
[in] [optional] format TimeStamp format string to be used when displaying or interpreting an OraTimeStamp object as a string. If format is not specified, the TimeStamp string is interpreted using the session TIMESTAMP format (NLS_TIMESTAMP_FORMAT format).

Return Values

OraTimeStamp Object

Remarks

An OraSession object must created before an OraTimeStamp 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 not specified, the string format must match the session TIMESTAMP format (NLS_TIMESTAMP_FORMAT).

If format is specified, it is stored in the Format property of the OraTimeStamp ; otherwise, the session TIMESTAMP format is stored in the OraTimeStamp Format property.

Examples

Dim oraTS as OraTimeStamp 
Dim oraTS1 as OraTimeStamp 
Dim date as Date 
 
'Create an OraTimeStamp using a string assuming the session  
'TIMESTAMP format is "DD-MON-RR HH.MI.SSXFF AM" 
Set oraTS = oo4oSession.CreateOraTimeStamp("12-JAN-2003 12.0.0.0 PM") 
 
'Create an OraTimeStamp using a string and a format 
Set oraTS = oo4oSession.CreateOraTimeStamp("2003-01-12 12:00:00 PM", _ 
         "YYYY-MM-DD HH:MI:SS AM") 
 
'Create an OraTimeStamp using a Date 
date = #1/12/2003# 
 
Set oraTS = oo4oSession.CreateOraTimeStamp(date) 
 
'Create an OraTimeStamp  using an OraTimeStamp 
Set oraTS1 = oo4oSession.CreateOraTimeStamp(oraTS)