DateTimeFormatInfo: format

format

Formats a cDateTime object or Date value in the pattern specified by the formatting command. If no command is specified, then G' is assumed. If the command cannot be found, then a custom pattern is assumed.



 Public Function format(
	  ByRef Value As Variant,
	  Optional ByVal fmt As String ) As String

Parameters

Value
[ByRef] Variant. The date to be formatted.
fmt
[ByVal] Optional. String. The formatting command or custom pattern to format the date to.

Return Values

String -  The formatted date value.

Remarks

Formatting can be accomplished by either specifying a formatting command, or entering a custom date format.

D - LongDatePattern
d - ShortDateTimePattern
F - FullDateTimePattern (Long Date and Long Time)
f - Full date and time (Long Date and Short Time)
G - General (Short Date and Long Time)
g - General (Short Date and Short Time)
m,M - MonthDayPattern
r,R - RFC1123Pattern
s - SortableDateTimePattern
T - LongTimePattern
t - ShortTimePattern
U - Full Date and Time (Long Date, Long Time) using universal time
u - UniversalSortableDateTimePattern
y,Y - YearMonthPattern

See Also

Project VBCorLib Overview Class DateTimeFormatInfo Overview DateTimeFormatInfo Properties DateTimeFormatInfo Methods FirstDayOfWeek (let) FullDateTimePattern (get)