Click or drag to resize

SToD Function

X#
Convert an ANSI date string to date format.

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

Parameters

cDate
Type: String
A date in the ANSI format yyyymmdd.
The century digits must be specified.
If cDate contains more than the eight characters required for the date, the extra characters are ignored.

Return Value

Type: Date
A date in the current SetDateFormat() or SET DATE format. If cDate is not a valid ANSI date, a NULL_DATE is returned.
Remarks
SToD() is a date function that converts an ANSI date created by the DToS() function back into the standard date format.
Examples
This example displays the ANSI date in default date format:
X#
1? SToD("19981028")             // 10/28/98
2? SToD("981028")             // NULL_DATE
3? SToD("19981028extra")      // 10/28/98
See Also