GetDocklightTimeStamp

<< Click to Display Table of Contents >>

Navigation:  Reference (Scripting) > Docklight Script Commands - The DL Object > Methods >

GetDocklightTimeStamp

Returns the current Docklight date/time stamp, according to the following settings:

 
1. The Docklight date/time stamp format chosen in the Options dialog:

Time stamp

Date stamp

Use time stamps with 1/100 seconds precision

 

2. The Windows setting for Region and Language > Formats > Short date and Long time

 

The GetDocklightTimeStamp function is especially useful for printing additional time information using the AddComment method.

 

Return Value

 

String

 

Syntax 1

 

result = DL.GetDocklightTimeStamp()

 

Remarks (Syntax 1)

 

GetDocklightTimeStamp adds a trailing space to the date/time string. This is for historical reasons and compatibility. See Syntax 2 for a trimmed version. See also the AddComment method.

 

Example 1

 

' Example GetDocklightTimeStamp

 

DL.ClearCommWindows

DL.StartCommunication

DL.AddComment "Communication started at " & DL.GetDocklightTimeStamp()

DL.AddComment "Waiting for data..."

 

' Endless loop to prevent the script from terminating immediately

Do

   DL.Pause 1 ' (the pause reduces CPU load while idle)

Loop

 

Syntax 2

 

result = DL.GetDocklightTimeStamp( [ myDateTime ] [, milliseconds ] [, trimmed ])

 

Part

Description

myDateTime

Optional. a VBScript Date (Time) variable which provides the date/time information in resolution "1 second".

0 (default) = Use Docklight's own time base.

milliseconds

Optional integer value with corresponding milliseconds from 0..999.

-1 (default) = Use Docklight's own time base.

-2 = Do NOT add the milliseconds part.

trimmed

Optional.

True = Remove the trailing space (see Syntax 1).

False (Default) = use the original format for compatibility.

 

Remarks (Syntax 2)

 

The extended syntax is typically used for formatting Receive Sequence timing information obtained within a Sub DL_OnReceive() event procedure. See the Example 2.

 

The argument milliseconds = -2 is useful when creating an export file for software like Excel that expects a standard Windows time format without milliseconds.