FormatDateTime()

Top  Previous  Next

FormatDateTime() - Creates a Formatted Date String

Description

The FormatDateTime() function creates a formatted date/time string from the supplied date.

FormatDateTime(Date[, Format])

Returns formatted string

Parameters
The Date parameter must be a formatted date string or a date variant to be formatted.

The optional Format parameter specifies the format to return based on [id=44#format]this table[/id].

Example

MyDate = FormatDateTime("1-Apr-64", 1)

'contains Wednesday, 1 April 1964

 

MyDate = FormatDateTime(now, 4)

'contains the time now in short format e.g. 16:24