点击或拖拽改变大小

Functions.CToDt 方法

X#
Convert a Date string to DateTime.

命名空间:  XSharp.Core
程序集:  XSharp.Core (在 XSharp.Core.dll 中) 版本:2.22 GA
语法
 FUNCTION CToDt(
	cDate AS STRING,
	cDateFormat AS STRING
) AS DateTime
查看代码

参数

cDate
类型:String
A string of numbers representing the month, day, and year, separated by any character other than a number. The month, day, and year digits must be in the format set by SetDateFormat() or SetDateCountry(). If the century digits are not specified, the century is determined by the rules of SetEpoch().
cDateFormat
类型:String
A string representating the date format to use when converting the string to a date. Should consist of D, M and Y characters and separators.

返回值

类型:DateTime
The DateTime value that corresponds to the numbers specified in cDate. If cDate is not a valid date, CToDt() returns a DateTime.MinValue.
参见