天软金融分析.NET函数大全 > TSL函数 > 基础函数 > 日期时间 > 日期重组函数

RecodeTime    

简述

将参数Ayear、Amonth、Aday、AHour、AMinute、Asecond、AMilliSecond分别指定小时、分钟、秒钟、毫秒替换掉参数AValue中的相应的小时、分钟、秒钟、毫秒信息,保留日期信息,得到的日期时间类型返回
定义
RecodeTime(AValue: TDateTime; AHour; AMinute; ASecond; AMilliSecond: Integer): TDateTime;
参数
名称类型说明
AValue TDateTime日期时间类型,日期时间
AHour Integer整数,小时,定义域[0,24]
AMinute Integer整数,分钟,定义域[0,59]
ASecond Integer整数,秒钟,定义域[0,59]
AmilliSecond Integer整数,毫秒,定义域[0,999]
返回 TDateTime
日期时间
  • 范例


    newTime:=RecodeTime(strtodatetime("2011-08-10 12:12:12.999"),10,8,9,100);
    return datetimetostr(newTime);//输出: 2011-08-10 10:08:09
    参考
    TDateTime 
相关