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

ToDate Method

Applies To

OraTimeStamp Object

OraTimeStampTZ Object

Description

Returns a copy of the Date type from the OraTimeStamp or OraTimeStampTZ object.

Arguments

None.

Usage

Set date = OraTimeStampObj.ToDate

Set date = OraTimeStampTZObj.ToDate

Remarks

In Visual Basic, this method returns the datetime values in the Date data type. As a result, the datetime values may be adjusted if they fall outside the range allowed by a VB date.

For an OraTimeStamp object: Returns a new Date object with the same date time values as the current OraTimeStamp object, but the nanosecond portion is truncated.

For an OraTimeStampTZ object: Returns a new Date object with the same date time values as the current OraTimeStampTZ object, but the nanosecond portion and time zone portion are truncated.

Example

Using OraTimeStamp

Dim OraTimeStamp As OraTimeStamp

...

'Create OraTimeStamp using a string

Set OraTimeStamp = OraSession.CreateOraTimeStamp("1999-APR-29

    12:10:23.444 AM", "YYYY-MON-DD HH:MI:SS.FF AM")

' returns a Date type with date value set to "1999-APR-29 12:10:23 AM"

' note that the fractional part is dropped

Set date = OraTimeStamp.ToDate

Using OraTimeStampTZ

Dim OraTimeStampTZ As OraTimeStampTZ

...

'Create OraTimeStampTZ using a string

Set OraTimeStampTZ = OraSession.CreateOraTimeStampTZ("2000-12-28

    12:10:23.444 -07:00", "YYYY-MM-DD HH:MI:SS.FF TZH:TZM")

'returns a Date type with date value set to "2000-12-28 12:10:23"

'note that Time Zone and nanosecond portions are dropped

Set date = OraTimeStampTZ.ToDate