天软金融分析.NET函数大全
>
TSL函数
>
基础函数
>
日期时间
>
常用日期时间函数
TryStrToDateTime
复制链接
简述
将字符串S转换成TDateTime类型的日期和时间并存到参数Value中。如果转换成功,则返回真,否则返回假
定义
TryStrToDateTime(S: String; Var Value: TDateTime): Boolean;
参数
名称
类型
说明
S
String
字符串,日期的字符串类型,如"2014-01-17"
Value
TDateTime
日期时间,返回值
返回
Boolean
布尔值,转化成功与否。
范例
If TryStrToDateTime("2010-02-04 16:11:35 ",datetime) then
Return datetime;//输出40213.67
参考
TDateTime
SetFormatLocalCode
GetFormatLocalCode
相关
EncodeDate
EncodeTime
TryEncodeDate
TryEncodeTime
DecodeDate
DecodeDateFully
DecodeTime
DayOfWeek
Date
Time
Now
CurrentYear
IncAMonth
IsLeapYear
DateToStr
TimeToStr
DateTimeToStr
StrToDate
StrToDateDef
TryStrToDate
StrToTime
Strtodatetime2
StrToTimeDef
TryStrToTime
StrToDateTime
StrToDateTimeDef
TryStrToDateTime
FormatDateTime
DateTimeToString
DateTimeToInternetStr
DateTimeGMTToCookieStr
DateTimeGMTToHttpStr
GMTToLocalDateTime