Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- adicionar na uses JclDateTime ;
- procedure TForm1.btn1Click(Sender: TObject);
- var ldtData : TDate;
- var ltHora : TTime;
- var lsAux : string;
- begin
- mmoDados.Clear;
- ldtData := StrToDate(edtData.Text);
- ltHora := StrToTime(edtHora.Text);
- with mmoDados.Lines do
- begin
- lsAux := IntToStr(CenturyOfDate(ldtData));
- Add('Século: '+lsAux);
- lsAux := IntToStr(DayOfDate(ldtData));
- Add('Dia: '+lsAux);
- lsAux := IntToStr(MonthOfDate(ldtData));
- Add('Mês: '+lsAux);
- lsAux := IntToStr(YearOfDate(ldtData));
- Add('Ano: '+lsAux);
- lsAux := 'Não';
- if ISLeapYear(ldtData) then
- lsAux := 'Sim';
- Add('Bissexto: '+lsAux);
- lsAux := IntToStr(GetISOYearNumberOfWeeks(YearOfDate(ldtData)));
- Add('Nro Semanas do ano: '+lsAux);
- lsAux := IntToStr(DaysInMonth(ldtData));
- Add('Dias no mês: '+lsAux);
- lsAux := DateToStr(EasterSunday(YearOfDate(ldtData)));
- Add('Páscoa: '+lsAux);
- lsAux := IntToStr(HourOfTime(ltHora));
- Add('Hora: '+lsAux);
- lsAux := IntToStr(MinuteOfTime(ltHora));
- Add('Minutos: '+lsAux);
- lsAux := IntToStr(SecondOfTime(ltHora));
- Add('Segundos: '+lsAux);
- lsAux := IntToStr(HoursToMSecs(HourOfTime(ltHora)));
- Add('Hora MS: '+lsAux);
- lsAux := IntToStr(MinutesToMSecs(MinuteOfTime(ltHora)));
- Add('Minutos MS: '+lsAux);
- lsAux := IntToStr(SecondsToMSecs(SecondOfTime(ltHora)));
- Add('Segundos MS: '+lsAux);
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement