GetFormattedDateTime

Converts a given timestamp to a formatted string. You can choose from several date and time formats, including formats that return only the date or the time.

Syntax

<HsvResourceManager>.GetFormattedDateTime(lFormatType, dDateTime)

Argument

Description

lFormatType

Long (ByVal). The format of the string to return. Valid values are represented by the HFMConstants type library constants listed in Date and Time Format Constants.

dDateTime

Double (ByVal). The timestamp.

Return Value

Variant. The formatted string.

Example

The following function uses the 24-hour time format to return the time segment of a given timestamp.

Function getTime24String(dTimeStamp As Double) As String
Dim cResourceManager As HsvResourceManager
Set cResourceManager = New HsvResourceManager
cResourceManager.Initialize HFM_TIER1
getTime24String = cResourceManager.GetFormattedDateTime _
   (HFM_DATE_TIME_FORMAT_HHHH_MI_SS, CDbl(Now))
End Function