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

RecodeDateTime    

简述

将参数Ayear、Amonth、Aday、AHour、AMinute、Asecond、AMilliSecond分别指定年份、月份、日期、小时、分钟、秒钟、毫秒替换掉参数AValue中的相应的年份、月份、日期、小时、分钟、秒钟、毫秒信息。对于不改变的变量,可以设置为65535(最大的WORD类型值),来告诉函数此参数对应的响应时间部分不需替换。函数得到的TDateTime类型返回
定义
RecodeDateTime(AValue: TDateTime; AYear; AMonth; ADay; AHour; AMinute; ASecond; AMilliSecond: Integer): TDateTime;
参数
名称类型说明
AValue TDateTime日期时间类型,被替换的日期时间
AYear Integer整数,年份,定义域[0,9999]
AMonth Integer整数,月份,定义域[0,12]
ADay Integer整数,日期,定义域[0,12],并且要使Ayear、Amonth、Aday组成的时间有效
AHour Integer整数,小时,定义域[0,24]
AMinute Integer整数,分钟,定义域[0,59]
ASecond Integer整数,秒钟,定义域[0,59]
AmilliSecond Integer整数,毫秒,定义域[0,999]
  • 范例


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