Click or drag to resize

DToC Function

X#
Convert a date to a string.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION DToC(
	dDate AS DATE
) AS STRING
Request Example View Source

Parameters

dDate
Type: Date
The date value to convert.

Return Value

Type: String
A string representation of dDate, formatted in the current date format.
A NULL_DATE returns a string of spaces equal in length to the current date format.
Remarks
DToC() is a date conversion function used for formatting purposes when you want to display the date in the SetDateFormat() or SetDateCountry() format or when a string is required (in a LABEL FORM, for example).
If you need a specialized date format, you can use Transform() or a custom expression. Since DToS() is in the form of yyyymmdd, it is usually the preferred form for indexing a date in combination with a string.
Examples
These examples show general uses of DToC():
X#
1? TODAY()                                // 09/01/98
2? DTOC(TODAY())                        // 09/01/98
3? "Today is " + DTOC(TODAY())                // Today is 09/01/98
See Also