DToS Function | |
Convert a date value to a string formatted as yyyymmdd.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION DToS(
dDate AS DATE
) AS STRING
public static string DToS(
Date dDate
)
Request Example
View SourceParameters
- dDate
- Type: Date
The date value to convert.
Return Value
Type:
String
An 8-character string in the format yyyymmdd.
If
dDate is a NULL_DATE, a string of eight spaces is returned.
The return value is not affected by the current date format.
Remarks
DToS() is a date conversion function that is used when creating order keys consisting of a date value and a string. DToS() converts a date value to a string that can be concatenated to any other string.
The return value is structured to preserve date order (year, month, and day).
Examples
These examples simply apply DToS() to a date:
1? TODAY()
2? DTOS(TODAY())
This example applies DToS() to a date literal and reports its length:
This example demonstrates how to create an order with a compound date and character key using DToS():
1USE sales NEW
2INDEX ON DTOS(SaleDate) + LastName TO datename
See Also