target.FormatDate

Description

Formats a date value according to a specified format.

Syntax

Function FormatDate(value, format(optional), time(optional))

Parameters

variant value - data value to be formatted

variant format (optional, default value = false) - either a string containing the desired date format (See date formats) or a boolean (false: the default date format, true: SQL compatible date format.)

boolean time (optional, default value = false) - applicable if the first parameter is a boolean; true: include the time portion in the return value, false: do not include the time portion in the return value

Return value

string -  a text representation of the date value according to the specified format

Example

Sample code

Dim dt, val

dt  = CDate( "11/16/2005 13:34:12" )

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

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

See also

Platform Objects and Methods

target.Execute

target.FormatNumeric

Target Methods