天软金融分析.NET函数大全
>
TSL函数
>
基础函数
>
日期时间
>
常用日期时间函数
DateTimeToString
复制链接
简述
根据参数Format给定的格式串将参数DateTime转换成字符串类型存到参数Result中,其中格式串的使用参照FormaTDateTime函数
定义
DateTimeToString(var Result: String; Format: String;DateTime: TDateTime);
参数
名称
类型
说明
Result
字符串,返回值
Format
字符串,格式串
DateTime
TDateTime类型,需转换的日期时间
返回
string
范例
DateTimeToString(result,'YYYY-MM-DD HH:NN:SS',now()) ;
Return result;//输出当期系统日期时间
参考
TDateTime
SetFormatLocalCode
GetFormatLocalCode
差异说明
在不同操作系统中,返回的日期格式会有所差异,差异同FormaTDateTime,FAQ:
FormatDateTime
相关
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