CToDAnsi Function | |
Convert an ANSI date string to date format.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION CToDAnsi(
cDate AS STRING
) AS DATE
public static Date CToDAnsi(
string cDate
)
Request Example
View SourceParameters
- cDate
- Type: String
A string in the ANSI form yyyy.mm.dd, where yy, mm, and dd represent year, month, and day respectively.
The year, month, and day can be separated by any character other than a number.
cDate is always interpreted as an ANSI string and is not dependent on SetDateFormat() or SetDateCountry().
If the century digits are not specified, the century is determined by the rules of SetEpoch().
Return Value
Type:
Date
The date value that corresponds to the numbers specified in
cDate.
If
cDate is not a valid ANSI date, CToDAnsi() returns a NULL_DATE.
Remarks
CToDAnsi() is a character conversion function that converts an ANSI date string to a date data type.
Examples
This examples simply applies CToDAnsi() to a string:
This example shows the effect of SetCentury():
1SetCentury(TRUE)
2? CToDAnsi("2084/10/23")
3? CToDAnsi("90$05$14")
This example shows that CToDAnsi() is not nation-dependent:
1SetDateCountry(GERMAN)
2? CToDAnsi("84/10/23")
See Also