6常用日期与时间函数.doc_第1页
6常用日期与时间函数.doc_第2页
6常用日期与时间函数.doc_第3页
6常用日期与时间函数.doc_第4页
6常用日期与时间函数.doc_第5页
已阅读5页,还剩37页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Delphi 6常用日期与时间函数D.1 获取特定的日期与时间本小节将为您介绍Delphi 6所提供的获取特定日期与时间的函数。这些函数稍后将有详细的范例说明。笔者这里将以列表的方式先说明每一个函数所代表的意义,如图示:函数名称单元文件所代表的意义NowSysUtils此函数可返回现在的日期与时间,其返回值为TDateTime类型DateSysUtils此函数可返回现在的日期,其返回值为TDateTime类型TimeSysUtils此函数可返回现在的时间,其返回值为TDateTime类型TodayDateUtils此函数可返回今天的日期,其返回值为TDateTime类型,此函数的结果与Date函数相同。TomorrowDateUtils此函数可返回昨天的日期,其返回值为TDateTime类型YesterdayDateUtils此函数可返回明天的日期,其返回值为TDateTime类型CurrentyearSysUtils此函数可返回现在所属的年度,其返回值为4的整数。例如:2001HoursperdaySysUtils此常数定义每天的小时数。HoursPerDay =24;MinsperdaySysUtils此常数定义每天的分钟数。MinsPerDay = MinsPerDay*60SecsperdaySysUtils此常数定义每天的秒数。SecPerDay = MinsPerDay *60msecsperdaySysUtils此常数定义每天的毫秒数。MSecsPerDay =SecsperDay*1000 Now (返回当前的日期时间)引用单元:SysUtils函数声明:Function Now : TDateTime;范例D-1Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;begin MyDateTime :=Now; Showmessage(DateTimeToStr(MyDateTime);end; Date(返回当前的日期)引用单元:SysUtils函数声明:Function Day :TDateTime;范例D-2Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;begin MyDateTime :=Date; Showmessage(DateTimeToStr(MyDateTime);end; Time(返回当前的时间)引用单元:SysUtils函数声明:Function Time:TDateTime;范例D-3Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;begin MyDateTime :=Time; Showmessage(DateTimeToStr(MyDateTime);end; Today(返回今天的日期)引用单元:DateUtils函数声明:Function Today :TDateTime;范例D-4Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;Begin /uses DateUtils MyDateTime :=Today; Showmessage(DateTimeToStr(MyDateTime);end; Tomorrow(返回明天的日期)引用单元:DateUtils函数声明:Function Tomorrow:TDateTime;范例D-5Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;Begin /uses DateUtils MyDateTime :=Tomorrow; /MyDateTime : Now +1; /两者相同Showmessage(DateTimeToStr(MyDateTime); /不包含时间部分end; Yesterday(返回昨天的日期)引用单元:DateUtils函数声明:Function Yesterday :TDateTime;范例D-6Procedure TForm1.Button1Click(Sender: TObject);Var MyDateTime : TDateTime;Begin /uses DateUtils MyDateTime :=Yesterday; /MyDateTime : Now -1; /两者相同Showmessage(DateTimeToStr(MyDateTime); /不包含时间部分end; CurrentYear(返回现在所属的年度)引用单元:SysUtils函数声明:Function CurrentYear :Word;范例D-7Procedure TForm1.Button1Click(Sender: TObject);Var ThisYear: Word;Begin this year := CurrentYear;Showmessage(IntToStr(ThisYear); / 4位整数end; HoursPerDay、MinsPerDay、SecsPerDay及MsecsPerDay等日期与时间常数。引用单元:SysUtils函数声明:Function CurrentYear:Word;范例D-8Procedure TForm1.Button1Click(Sender: TObject);BeginShowmessage(每天的小时数= + IntToStr(HoursperDay); /24 Showmessage(每天的分钟数= + IntToStr(MinsperDay); / 1440Showmessage(每天的秒数= + IntToStr(SecsperDay); /24 Showmessage(每天的毫秒数= + IntToStr(MSecsperDay); /24 end;D.2 日期处理函数:函数名称单元文件所代表的意义YearOfDateUtils此函数可获取TDateTime格式中的年度,其返回值为Word类型。YearsBeTweenDateUtils此函数可返回两个指定日期间的年份,一年以365.25天为计算单位。其返回值不包含小数部分YearSpanDateUtils此函数可返回两个指定日期间的年份,一年以365.25天为计算单位。其返回值包含小数部分StartOfAYearDateUtils此函数可返回特定年份的第一天EndOfAYearDateUtils此函数可返回特定年份的最后一天StrtOfTheYearDateUtils此函数可返回特定日期的该年第一天EndOfTheYearDateUtils此函数可返回特定日期的该年最后一天IncYearDateUtils此函数可将指定的TDateTime变量加上指定的年度,其默认值为1年MonthOfDateUtils此函数可获取TDateTime格式中的月份,其返回值为Word类型MonthOfTheYearDateUtils此函数可获取TDateTime格式中的月份,其返回值为Word类型MonthBetweenDateUtils次函数可返回两个指定日期间的月份数,一个月以30.4375天为计算单位。其返回值不包含小数部分MonthSpanDateUtils次函数可返回两个指定日期间的月份数,一个月以30.4375天为计算单位。其返回值包含小数部分StartOfAMonthDateUtils此函数可返回特定年月的第一天EndOfAMonthDateUtils此函数可返回特定年月的最后一天StartOfTheMonthDateUtils此函数可返回指定日期的该年的第一天EndOfTheMonthDateUtils此函数可返回指定日期的该年的最后一天IncMonthDateUtils此函数可将指定的TDateTime变量加上指定的月份,其默认值为加上1个月IncAMonthDateUtils此函数可将指定的年月日加上指定的月份,其默认值为加上1个月DaysInAYearDateUtils此函数可返回指定年份的总天数DaysInYearDateUtils此函数可返回指定TDateTime变量中该年分的总天数DaysInAMonthDateUtils此函数可返回指定月份的总天数DaysInMonthDateUtils此函数可返回指定TDateTime变量中该月份的总天数DaysOfDateUtils此函数可获取TDateTime格式中的日期,其返回值为Word类型DaysBetweenDateUtils此函数可获取格式中的日期,其返回值不包含小数部分DaySpanDateUtils此函数可返回两个指定日期间的天数,其返回值包含小数部分DayOfTheYearDateUtils此函数可返回指定TDateTime变量为该年的第几天。例如2月1日则返回32DayOfTheMonthDateUtils此函数可返回指定TDateTime变量为该月的第几天,其返回值介于1到31DayOfTheWeekDateUtils此函数可返回指定TDateTime变量为该周的第几天,其返回值介于1到7。星期一为第一天。DayOfWeekDateUtils此函数可返回指定TDateTime变量为该周的第几天,其返回值介于1到7。星期日为第一天。StartOfADayDateUtils此函数可返回指定日期一天的开始时间,其返回值为TDateTime类型。其时间默认为12:00:000 AMEndOfADayDateUtils此函数可返回指定日期一天的结束时间,其返回值为TDateTime类型。其时间默认为11:59:999 PMStartOfTheDayDateUtils此函数可返回指定TDateTime变量的一天开始时间,其返回值为TDateTime类型。其时间默认为:12:00:000 AMEndOfTheDayDateUtils此函数可返回指定TDateTime变量的一天结束时间,其返回值为TDateTime类型。其时间默认为11:59:999PMIncDayDateUtils此函数可为指定日期加上特定的天数,其返回值为TDateTime类型,其默认天数为1天WeeksInAYearDateUtils此函数可返回指定年度的周数,其返回值不是52就是53WeeksInYearDateUtils此函数可返回指定TDateTime变量的周数,其返回值不是52就是53WeekOfDateUtils次函数可返回指定日期为该年的第几周,其返回值为153WeekOfTheYearDateUtils次函数可返回指定日期为该年的第几周,其返回值为153WeekOfTheMonthDateUtils次函数可返回指定日期为该月的第几周,其返回值为16WeeksBetweenDateUtils此函数可返回两个指定日期间的周数,其返回值不包含小数部分WeekSpanDateUtils此函数可返回两个指定日期间的周数,其返回值包含小数部分StartOfAweekDateUtils此函数可返回指定日期一周的开始时间,其返回值为TDateTime类型。其时间默认为12:00:000 PMEndOfAWeekDateUtils此函数可返回指定日期一周的结束时间,其返回值为TDateTime类型。其时间默认为11:59:999 PMStartOfTheWeekDateUtils此函数可返回指定TDateTime变量的一周开始时间,其返回值为TDateTime类型。其其时间默认为12:00:000 AMEndOfTheWeekDateUtils此函数可返回指定TDateTime变量的一周结束时间,其返回值为TDateTime类型。其时间默认为11:59:999 AMIncWeekDateUtils此函数可将指定日期加上指定周数,其返回值为TDateTime类型 YearOf(返回指定日期的年度)引用单元:DateUtils函数声明:Function YearOf ( const AValue : TDateTime) :Word;范例D-9Procedure TForm1.Button1Click(Sender: TObject);Begin /三者都相同 Showmessage(年度= + IntToStr(YearOf(Now); Showmessage(年度= + IntToStr(YearOf(Date); Showmessage(年度= + IntToStr(YearOf(Today); end; YearsBetween(返回两个指定日期间的年份)引用单元:DateUtils函数声明:Function YearsBetween ( const ANow, AThen : TDateTime) :Integer;范例D-10Procedure TForm1.Button1Click(Sender: TObject);Begin/不包含小数,一年以365.25天为计算单位Showmessage(几年= + IntToStr(YearsBetween(Now,Now+560); /1end; YearSpan(返回两个指定日期间的年份)引用单元:DateUtils函数声明:Function YearsSpan( const ANow , AThen : TDateTime) :Double;范例D-11Procedure TForm1.Button1Click(Sender: TObject);Begin/包含小数,一年以365.25天为计算单位Showmessage(几年= + FloatToStr(YearSpan(Now,Now+560); /1.53.end; StartOfAYear(返回特定年份的第一天)引用单元:DateUtils函数声明:Function StartOfAYear ( const AYear) : TDateTime;范例D-12Procedure TForm1.Button1Click(Sender: TObject);BeginShowmessage(DateTimeToStr(StartOfAYear(2001);/2001/1/1 早上12:00:00end; EndOfAYear(返回特定年份的最后一天)引用单元:DateUtils函数声明:Function EndOfAYear ( const AYear) : TDateTime;范例D-13Procedure TForm1.Button1Click(Sender: TObject);BeginShowmessage(DateTimeToStr(EndOfAYear(2001);/2001/12/31 下午11:59:59end; StartOfTheYear(返回指定日期的该年的第一天)引用单元:DateUtils函数声明:Function StartOfTheYear ( const AValue : TDateTime) :TDateTime;范例D-14Procedure TForm1.Button1Click(Sender: TObject);BeginShowmessage(DateTimeToStr(StarOfTheYear(Now);/指定的年度/1/1早上12:00:00end; EndOfTheYear(返回指定日期的该年的最后一天)引用单元:DateUtils函数声明:Function EndOfTheYear ( const AValue : TDateTime) :TDateTime;范例D-15Procedure TForm1.Button1Click(Sender: TObject);BeginShowmessage(DateTimeToStr(StarOfTheYear(Now);/指定年度/12/31下午11:59:59end; IncYear(将指定的TDateTime变量加上指定的年)引用单元:DateUtils函数声明:Function IncYear ( const AValue : TDateTimel; const ANumberOfYears : Integer =1) :TDateTime;范例D-16 Procedure TForm1.Button1Click(Sender: TObject);var myDateTime : TDateTime;Begin myDateTime : = IncYear(Now,3); /往后加3年 Showmessage(DateTimeToStr(myDateTime);End; MonthOf(获取TDateTime格式中的月份)引用单元:DateUtils函数声明:Function MonthOf ( const AValue : TDateTime) :Word;范例D-17 Procedure TForm1.Button1Click(Sender: TObject);var myDateTime : TDateTime; m : Integer;Begin myDateTime : = Now; /两个函数获取相同的结果m := MonthofTheYear(myDateTime); Showmessage(IntToStr(m);end; MonthOfTheYear(获取TDateTime格式中的月份)引用单元:DateUtils函数声明:Function MonthOfTheYear ( const AValue : TDateTime) :Word;范例D-18 Procedure TForm1.Button1Click(Sender: TObject);vari :Integer;f :Double;Begin i := MonthsBetween(Now,Now+89);/差89天 Showmessage(IntToStr(i);/2 f := MonthSpan(Now,Now+89);/差89天 Showmessage(FloatToStr(f);/2.924End; MonthsBetween(返回两个指定日期间的月份数)引用单元:DateUtils函数声明:Function MonthsBetween ( const ANow, AThen : TDateTime) :Integer; MonthSpan(返回两个指定日期间的月份数)引用单元:DateUtils函数声明:Function MonthSpan ( const ANow, AThen : TDateTime) :Double; StartOfAMonth(返回特定年月的第一天)引用单元:DateUtils函数声明:Function StartOfAMonth ( const AYear, AMonth : Word) : TDateTime; EndOfAMonth(返回特定年月的最后一天)引用单元:DateUtils函数声明:Function EndOfTheMonth ( const AYear, AMonth : Word) : TDateTime; StartOfTheMonth(返回特定年月的第一天)引用单元:DateUtils函数声明:Function StartOfTheMonth ( const AValue : TDateTime) :TDateTime; EndOfTheMonth(返回特定年月的最后一天)引用单元:DateUtils函数声明:Function EndOfTheMonth ( const AValue : TDateTime) :TDateTime;范例D-19var myDateTime :TDateTime; Year,Month :Integer;Begin Year := YearOf(Now); Month :=MonthOf(Now); /找出当前月份的第一天 myDateTime := StartOfAMonth(Year,Month); Showmessage(DateTimeToStr(myDateTime); /找出当前月份的最后一天 myDateTime := EndOfAMonth(Year,Month); Showmessage(DateTimeToStr(myDateTime); /找出当前月份的第一天 myDateTime := StartOfTheMonth(Now); Showmessage(DateTimeToStr(myDateTime); /找出当前月份的最后一天 myDateTime := EndOfTheMonth(Now); Showmessage(DateTimeToStr(myDateTime);end; IncMonth(指定的TDateTime变量加上指定的月份)引用单元:DateUtils函数声明:Function IncMonth ( const Date : TDateTime ; NumberOfMonths : Integer = 1) :TDateTime; IncAMonth(指定的年月日变量加上指定的月份)引用单元:DateUtils函数声明:Procedure IncAMonth ( Var Year, Month , Day : Word ; NumberOfMonths : Integer =1 );范例D-20var myDateTime :TDateTime; Year,Month,Day :Word;Begin /加上指定的月份 myDateTime := IncMonth(Now,3);/加上三个月 Showmessage(DateTimeToStr(myDateTime); Year := YearOf(Now); Day := Dayof(Now);/加上指定的月份IncAMonth(Year,Month,Day,3);Showmessage(Month+IntToStr(Month);end ; DaysInAYear(返回指定年份的总天数)引用单元:DateUtils函数声明:Function DaysInAYear ( const AYear : Word) :Word; DaysInYear(返回指定TDateTime变量中该年份的总天数)引用单元:DateUtils函数声明:Function MinuteOfTheHour ( const AValue : TDateTime) :Word; DaysInAMonth(返回指定月份的总天数)引用单元:DateUtils函数声明:Function DaysInAMonth ( const AYear , AMonth : Word) :Word; DaysInMonth(返回指定TDateTime变量中该月份的总天数)引用单元:DateUtils函数声明:Function DaysInMonth ( const AValue : TDateTime) :Word;范例D-21procedure TForm1.Button1Click(Sender : TObfect) ;var myDateTime : TDateTime ; Year, Month : Word ; I : Integer ;Begin Year := YearOf(Now) ; /获取指定年份的总天数 i := DaysInAYear(Year) ; Showmessage(DaysInAYear=+IntToStr (i) ; i := DaysInYear(now) ; Showmessage(DaysInMonth = + IntToStr (i) ; /获取指定月份的总天数 Month := MonthOf(Now) ; i := DaysInMonth(Now) ; Showmessage( DaysInMonth = +IntToStr(i) ;end; DaysOf(获取TDateTime格式中的日期)引用单元:DateUtils函数声明:Function DaysOf ( const AValue : TDateTime) :Word;范例D-22procedure TForm1.Button1Click(Sender : TObfect) ;var Day : Word ;begin /获取指定TDateTime的日期 Day := DayOf(Now) ; Showmessage(IntToStr(Day) ;end ; DaysBetween(返回两个指定日期间的天数)引用单元:DateUtils函数声明:Function DaysBetween( const ANow, AThen : TDateTime) :Integer; DaySpan(返回两个指定日期间的天数)引用单元:DateUtils函数声明:Function DaySpan ( const ANow , AThen : TDateTime) :Double;范例D-23vari : Integer ;f : Double ;begin /获取两个日期的天数 f:=DaySpan(Now-100 , Now) ; i := DaysBetween(Now-100 , Now) ; Showmessage(intToStr(i) ; /100 Showmessage(FloatToStr(f) ; /100 end ; DayOfTheYear(返回指定TDateTime变量为该年的第几天)引用单元:DateUtils函数声明:Function DayOfTheYear ( const AValue : TDateTime) :Word; DayOfTheMonth(返回指定TDateTime变量为该月的第几天)引用单元:DateUtils函数声明:Function DayOfTheMonth ( const AValue : TDateTime) :Word; DayOfTheWeek(返回指定TDateTime变量为该周的第几天)引用单元:DateUtils函数声明:Function DayOfTheWeek ( const AValue : TDateTime) :Word; DayOfWeek(返回指定TDateTime变量为该周的第几天)引用单元:DateUtils函数声明:Function DayOfWeek ( Date : TDateTime) :Integer;范例D-24procedure TForm1.Button1Click(Sender : TObfect) ;var i : Integer ;begin /返回指定TDateTime为该年的第几天 i := DayOfTheYear(Now) ; Showmessage(IntToStr(i) ; /返回指定TDateTime为该月的第几天 i := DayOfTheMonth(Now) ; Showmessage(IntToStr(i) ; /返回指定TDateTime为该周的第几天(星期一为第一天) i := DayOfTheWeek(Now) ; Showmessage(IntToStr(i) ;end ; StartOfADay(返回指定日期一天的开始)引用单元:DateUtils函数声明:Function StartOfADay ( const AYear , AMonth, ADay : Word) :TDateTime; Function StartOfADay ( const AYear , ADayOfYear : Word) :TDateTime;范例D-25procedure TForm1.Button1Click(Sender : TObfect) ;var tmpDateTime : TDateTime ; AYear , ADayOfYear , AMonth , ADay :Word ;begin AYear := 2001 ; /指定年度 ADayOfYear := 32 ;./第32天 tmpDateTime :=StartOfADay(AYear , ADayOfYear) ; Showmessage(DateTimeToStr(tmpDateTime) ; /2001/02/01 AMonth := 1 ; ADay := 32 ; /从AMonth第一天起第32天 TmpDateTime := StartOfADay(AYear , AMonth , ADay) ;Showmessage(DateTimeToStr(tmpDateTime) ; /2001/02/01end ; EndOfADay(返回指定日期一天的结束时间)引用单元:DateUtils函数声明:Function EndOfADay ( const AYear, AMonth,ADay : Word) : TDateTime; Function EndOfADay ( const AYear, ADayOfYear : Word) : TDateTime;范例D-26procedure TForm1.Button1Click(Sender : TObfect) ;var tmpDateTime : TDateTime ; AYear , ADayOfYear , AMonth , ADay : Word ;beginAYear := 2001 ; /指定年度 ADayOfYear := 32 ; /第32天 tmpDateTime := EndOfADay(AYear , AMonth , ADay) ; Showmessage(DateTimeToStr(tmpDateTime) ; /2001/02/01 PM 11:59:59end ; StartOfTheDay(返回指定TDateTime变量的一天开始时间)引用单元:DateUtils函数声明:Function StartToTheDay ( const AValue : TDateTime) :TDateTime; EndOfTheDay(返回指定TDateTime变量的一天结束时间)引用单元:DateUtils函数声明:Function EndOfTheDay ( const AValue : TDateTime) : TDateTime;范例D-27procedure TForm1.Button1Click(Sender : TObfect) ;var tmpDateTime : TDateTime ;begin tmpDateTime := StartOfTheDay(Now) ; Showmessage(DateTimeToStr(tmpDateTime) ; /YYYY/MM/DD AM 12:00:00 tmpDateTime := EndOfTheDay(Now) ; Showmessage(DateToeTpStr(tmpDateTime) ; /YYYY/MM/DD PM 11:59:59end ; IncDay(可为指定日期加上特定的天数)引用单元:DateUtils函数声明:Function IncDay ( const AValue : TDateTime ; const ANumberOfDays : Integer =1) :TDateTime;范例D-28procedure TForm1.Button1Click(Sender : TObfect) ;var tmpDateTime : TDateTime ;begin tmpDateTime := Incday(Now,5) ; Showmessage(DateTimeToStr(tmpDateTime) ; /时间部分并不会改变end ; WeeksInAYear(返回指定年度的周数)引用单元:DateUtils函数声明:Function WeeksInAYear( const AYear : Word) :Word; WeeksInYear(返回指定TDateTime变量的周数)引用单元:DateUtils函数声明:Function WeeksInYear ( const AValue : TDateTime) :Word;范例D-29procedure TForm1.Button1Click(Sender : TObfect) ;varweeks : word ;begin weeks :=weeksInAYear(2001) ; Showmessage(IntToStr(weeks) ; /52 Weeks := WeeksInYear(Now) ; Showmessage(IntToStr(weeks) ; /52end ; WeeksOf(返回指定日期为该年的第几周)引用单元:DateUtils函数声明:Function WeekOf ( const AValue : TDateTime) :Word; WeekOfTheYear(返回指定日期为该年的第几周)引用单元:DateUtils函数声明:Function WeekOfTheYear ( const AValue : TDateTime) :Word; WeekOfTheMonth(返回指定日期为该月的第几周)引用单元:DateUtils函数声明:Function WeekOfTheMonth ( const AValue : TDateTime) :Word;范例D-30Procedure TForm1.Button1Click(Sender: TObject);Var I : Word;Begin I :=WeekOf(Now);Showmessage(weekof= + IntToStr(i); i := WeekOfTheYear(Now );Showmessage(WeekOfTheYear = + IntToStr(i);I := WeekOfTheMonth(Now); Showmessage(WeekOfTheMonth= + IntToStr(i); end; WeeksBetween(返回两个指定日期间的周数)引用单元:DateUtils函数声明:Function WeeksBetween ( const ANow , AThen, : TDateTime) :Integer; WeekSpan(返回两个指定日期间的周数)引用单元:DateUtils函数声明:Function WeekSpan( const ANow ,AThen : TDateTime) :Double;范例D-31Procedure TForm1.Button1Click(Sender: TObject);Var I : Integer; F :Double;Begin I :=WeeksBetween(Now , Now + 29);Showmessage(InttoStr(i); /4F := WeekSpan(Now , Now + 29); Showmessage(FloatToStr(f); /4.14end; StartOfAWeek(返回指定日期一周的开始时间)引用单元:DateUtils函数声明:Function StartOfAWeek ( const AYear , AWeekOfYear : Word; const ADayOfWeek : Word = 1) : TDateTime; EndOfAWeek(返回指定日期一周的结束时间)引用单元:DateUtils函数声明:Function EndOfAWeek ( const AYear , AWeekOfYear : Word; const ADayOfWeek : Word = 7) : TDateTime;范例D-32Procedure TForm1.Button1Click(Sender: TObject);Var tempDateTime: TDateTime; AYear , AWeekOfYear , ADayOfWeek : Word;Begin AYear := 2001;AWeekOfYear :=2; /第二周ADayOfWeek :=1; /第一天tempDateTime := StartofAweek(AYear, AWeekOfYear, ADayOfWeek);/2001/01/08 AM 12:00:00:00showmessage(DateTimeToStr(tempDateTime);/AYearf := 2001;/AWeekofYear :=2; /第二周ADayOfWeek : =7 ;/ 第七天tempDatetime := EndOfAWeek(AYear, AWeekOfYear, AdayOfWeek);/2001/01/14 Pm 11:59:59 Showmessage(DateTimeToStr(tempDateTime); /4.14end; StartOfTheWeek(返回指定日期一周的开始时间)引用单元:DateUtils函数声明:Function StartOfTheWeek ( const AValue : TDateTime) :TDateTime; EndOfTheWeek(返回指定日期一周的结束时间)引用单元:DateUtils函数声明:Function EndOfTheWeek ( const AValue : TDateTime) :TDateTime;范例D-33Procedure TForm1.Button1Click(Sender: TObject);Var tempDateTime : TDateTime;begin tempDateTime :=StartOfTheWeek(Now); /YYYY

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论