CorDateTime: ToString

ToString

Formats a CorDateTime 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 ToString(
	  Optional ByRef Format As String,
	  Optional ByVal Provider As IFormatProvider ) As String

Parameters

Format
[ByRef] Optional. String. The format inwhich the date should represent.
Provider
[ByVal] Optional. IFormatProvider. A formatting provider to format the date.

Return Values

String -  String representing this instance.

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 CorLib Overview

Class CorDateTime Overview

DateTimeFormatInfo