Copy Method for LCDatetime

This method makes a copy of an LCDatetime object.

Defined In

LCDatetime

Syntax

Set newDatetime = srcDatetime.Copy

Parameters

Parameter

Description

srcDatetime

LCDatetime. The datetime object that you want to copy.

Return Value

Value

Description

newDatetime

LCDatetime. The copy of the srcDatetime object.

Example

Option Public
Uselsx "*lsxlc"  
Sub Initialize
  Dim session As New LCSession
     ' In an LEI Scripted Agent, use the following syntax instead:
     ' Dim session As New LCSession ("mySession")
  Dim StopTime As New LCDateTime
  Dim StartTime As LCDatetime
  StopTime.SetCurrent
  Set StartTime = StopTime.Copy
  session.Sleep (100)  ' 100 milliseconds
  StopTime.SetCurrent
  Print "The difference between start and stop is:"
  Print StopTime.GetDiff (StartTime, LCDTUNIT_HUNDREDTH) & _
  " hundredths of a second."
End Sub

Example Output

The difference between start and stop is:
10 hundredths of a second