datatimepicker2的日期是datatimepicker1的去年今天 我要在DateTimePicker1的OnChange里写个事件,就是当DateTimePicker1改变的时候,DateTimePicker2显示的是去年当天,即当DateTimePicker1为2009-3-22时,DateTimePicker2的日期为2008-3-22,这个事件怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DateTimePicker2.DateTime := IncYear(DateTimePicker1.DateTime,-1) 行了,要加一句 uses DateTils;自己给分自己,呵呵 Date function Returns the current date. DateDelta constant Specifies the correction factor when computing the difference between two date and time types that do not begin in the same year. DateTimeToFileDate function Converts a TDateTime object to a DOS date-and-time value. DateTimeToStr function Converts a TDateTime value to a string. DateTimeToString procedure Converts a TDateTime value to a string using a specified Format. DateTimeToSystemTime procedure Converts a TDateTime value into the Win32 API's TSystemTime type. DateTimeToTimeStamp function Converts a TDateTime value into the corresponding TTimeStamp value. DateToStr function Converts a TDateTime value to a string. DayOfWeek function Returns the day of the week for a specified date. DecodeDate procedure Returns Year, Month, and Day values for a TDateTime value. DecodeTime procedure Breaks a TDateTime value into hours, minutes, seconds, and milliseconds. EncodeDate function Returns a TDateTime value that represents a specified Year, Month, and Day. EncodeTime function Returns a TDateTime value for a specified Hour, Min, Sec, and MSec. FormatDateTime function Formats a TDateTime value. IncMonth function Returns a date shifted by a specified number of months. IsLeapYear function Indicates whether a specified year is a leap year. MSecsPerDay constant Specifies the number of milliseconds per day. MSecsToTimeStamp function Converts a specified number of milliseconds into a TTimeStamp value. Now function Returns the current date and time. ReplaceDate procedure Replaces the date portion of a TDateTime value with a specified date. ReplaceTime procedure Replaces the time portion of a TDateTime value with a specified time. SecsPerDay constant Indicates the number of seconds per day. StrToDate function Converts a string to a TDateTime value. StrToDateTime function Converts a string to a TDateTime value. StrToTime function Converts a string to a TDateTime value. SystemTimeToDateTime function Converts a TSystemTime value into a TDateTime value. Time function Returns the current time. TimeStampToDateTime function Converts a TTimeStamp value into the corresponding TDateTime value. TimeStampToMSecs function Converts a TTimeStamp value into an absolute number of milliseconds. TimeToStr function Returns a string that represents a TDateTime value. 事务问题 送分呀 如何测试局域网中的机器通不通 ●●●●我要用ACCESS存取视频资料(如MPG,AVI等),谁能提供帮助****过节散分,大家快来啊●●●● 用DELPHI怎么做基于b/s的程序? StringList的出错 在Dll中在创建窗口时发生"尚未调用CoInitialize",不知道为什么??? 怎样获取DBGRID中鼠标点中的单元格的行号,列号和内容? 请问Delphi中 @a 和 @@b 代表什么类型? 怎么像刷屏软件一样捕抓到一个网页的EDIT 或 单选框或复选框。 access 自定义函数 ado insert的问题??
DateTimePicker2.DateTime := IncYear(DateTimePicker1.DateTime,-1)
自己给分自己,呵呵
Returns the current date.
DateDelta constant
Specifies the correction factor when computing the difference between two date and time types that do not begin in the same year.
DateTimeToFileDate function
Converts a TDateTime object to a DOS date-and-time value.
DateTimeToStr function
Converts a TDateTime value to a string.
DateTimeToString procedure
Converts a TDateTime value to a string using a specified Format.
DateTimeToSystemTime procedure
Converts a TDateTime value into the Win32 API's TSystemTime type.
DateTimeToTimeStamp function
Converts a TDateTime value into the corresponding TTimeStamp value.
DateToStr function
Converts a TDateTime value to a string.
DayOfWeek function
Returns the day of the week for a specified date.
DecodeDate procedure
Returns Year, Month, and Day values for a TDateTime value.
DecodeTime procedure
Breaks a TDateTime value into hours, minutes, seconds, and milliseconds.
EncodeDate function
Returns a TDateTime value that represents a specified Year, Month, and Day.
EncodeTime function
Returns a TDateTime value for a specified Hour, Min, Sec, and MSec.
FormatDateTime function
Formats a TDateTime value.
IncMonth function
Returns a date shifted by a specified number of months.
IsLeapYear function
Indicates whether a specified year is a leap year.
MSecsPerDay constant
Specifies the number of milliseconds per day.
MSecsToTimeStamp function
Converts a specified number of milliseconds into a TTimeStamp value.
Now function
Returns the current date and time.
ReplaceDate procedure
Replaces the date portion of a TDateTime value with a specified date.
ReplaceTime procedure
Replaces the time portion of a TDateTime value with a specified time.
SecsPerDay constant
Indicates the number of seconds per day.
StrToDate function
Converts a string to a TDateTime value.
StrToDateTime function
Converts a string to a TDateTime value.
StrToTime function
Converts a string to a TDateTime value.
SystemTimeToDateTime function
Converts a TSystemTime value into a TDateTime value.
Time function
Returns the current time.
TimeStampToDateTime function
Converts a TTimeStamp value into the corresponding TDateTime value.
TimeStampToMSecs function
Converts a TTimeStamp value into an absolute number of milliseconds.
TimeToStr function
Returns a string that represents a TDateTime value.