value.FormatDate

Description

Returns string representation of a date value, formatted according to the format specified.

Syntax

Function FormatDate(format, time)

Parameters

format (input) - the format of the date

time (input) - a boolean if you want to include the time

Return value

string - representation of the date value in the given format

Example

Sample code

Dim val

UserVar.value = CDate( "11/16/2005 13:34:12" )

val = UserVar.FormatDate( "DDDD, MMMM DD, YYYY" ) ' the return value: Wednesday, November 16, 2005

val = UserVar.FormatDate( "MM/DD/YYYY h:m:s p" ) ' the return value: 11/16/2005 1:34:12 PM

See also

Platform Objects and Methods

value.FormatNumeric

Value Object