Skip Headers
Oracle® Objects for OLE Developer's Guide
11g Release 2 (11.2) for Microsoft Windows

Part Number E17727-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

ToDate Method

Applies To

OraTimeStamp Object

OraTimeStampTZ Object

Description

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

Usage

Set date = OraTimeStampObj.ToDate
Set date = OraTimeStampTZObj.ToDate

Remarks

This method returns the datetime values in the Date data type. As a result, the date-time values can be adjusted if they fall outside the range allowed by a VB date.

Examples

Using the OraTimeStamp Object

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 the OraTimeStampTZ Object

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