为什么80%的码农都做不了架构师?>>>
DateUtils.IsValidDateTime
DateUtils.IsValidDate
DateUtils.IsValidTime
DateUtils.IsValidDateDay
DateUtils.IsValidDateWeek
DateUtils.IsValidDateMonthWeek//可用下面几个过程抛出异常:
DateUtils.InvalidDateDayError
DateUtils.InvalidDateMonthWeekError
DateUtils.InvalidDateTimeError
DateUtils.InvalidDateWeekError
DateUtils.InvalidDayOfWeekInMonthError
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;typeTForm1 = class(TForm)procedure FormCreate(Sender: TObject);end;varForm1: TForm1;implementation{$R *.dfm}uses DateUtils;procedure TForm1.FormCreate(Sender: TObject);
varb: Boolean;
beginb := IsValidDateTime(2009, 5, 21, 11, 22, 33, 999); //Trueb := IsValidDateTime(2009, 5, 21, 11, 22, 33, 9999); //Falseb := IsValidDate(2009, 5, 21); //Trueb := IsValidDate(2009, 5, 32); //Falseb := IsValidTime(11, 22, 33, 0); //Trueb := IsValidTime(11, 22, 61, 0); //Falseb := IsValidDateDay(2009, 141); //Trueb := IsValidDateDay(2009, 366); //Falseb := IsValidDateWeek(2009, 21, 7); //Trueb := IsValidDateWeek(2009, 21, 8); //Falseb := IsValidDateMonthWeek(2009, 5, 3, 7); //Trueb := IsValidDateMonthWeek(2009, 5, 3, 8); //False// ShowMessage(BoolToStr(b, True));
end;end.
DateUtils-Function