DIAdem Help

Method: FormatDateTime for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: FormatDateTime for VBS

Formats a date or time expression.

vFormatDateTime = Object.FormatDateTime(Date, [NamedFormat])
ObjectVBS
Object with this method. You do not need to specify this object.
DateVariant
Specifies the date or time expression you want to format.
[NamedFormat]Variant
Specifies the date and time format. Possible settings include vbGeneralDate, vbLongDate, vbShortDate, vbLongTime, and vbShortTime. If you do not specify a value, the FormatDateTime method uses the vbGeneralDate setting.
vFormatDateTimeVariant
Receives the formatted date or time expression.

The following example displays the current date and the current time:

Call MsgBox(FormatDateTime(Now, vbGeneralDate))

See Also

Objects Overview

Related Topics

FormatCurrency | FormatDateTime | FormatNumber | FormatPercent