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

RecodeDate    

简述

将参数Ayear、Amonth、Aday分别指定年份、月份、日期替换掉参数AValue中的相应的年份、月份、日期信息,保留时间信息,得到的日期时间类型返回
定义
RecodeDate(AValue: TDateTime; AYear; AMonth; ADay: Integer): TDateTime;
参数
名称类型说明
AValue TDateTime日期时间类型,日期时间
AYear Integer整数,年份,定义域[0,9999]
AMonth Integer整数,月份,定义域[0,12]
ADay Integer整数,日期,定义域[0,31],并且要使Ayear、Amonth、Aday组成的时间有效
返回 TDateTime
日期时间
  • 范例


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