GetDatetime Method for LCField

This method retrieves a Datetime data type from a value in a field. If the requested data type is different from the field data type, conversion is automatically performed. If conversion is not possible, error LCFAIL_INVALID_CONVERT occurs.

Defined In

LCField

Syntax

Set newDatetime = lcField.GetDatetime (index)

Parameters

Parameter

Description

index

Long, >= 1. Index of the field data value to be retrieved.

Return Value

Value

Description

newDatetime

LCDatetime. The value of the retrieved data type.

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim Fld As New LCField (LCTYPE_TEXT)
  Dim vDate As LCDateTime
  Fld.Text = "10/12/1998"
  Set vDate = Fld.GetDatetime (1)
  Print "The Datetime representation of the field is " & vDate.Text
End Sub

Example Output

The Datetime representation of the field is 10/12/1998.