Welcome

Welcome, thanks to look my blog

Friday 18 December 2015

DecodeDate (Delphi)

DecodeDate (Delphi)

Language:

sumber:http://docwiki.embarcadero.com/CodeExamples/Seattle/en/DecodeDate_(Delphi)

Description

This example uses a button and two labels on a form. When the user clicks the button, the current date and time are reported in the captions of the two labels.

Code

procedure TForm1.Button1Click(Sender: TObject);
var
  Present: TDateTime;
  Year, Month, Day, Hour, Min, Sec, MSec: Word;
 begin
  Present:= Now;
  SysUtils.DecodeDate(Present, Year, Month, Day);
  Label1.Caption := 'Today is Day ' + IntToStr(Day) + ' of Month '
    + IntToStr(Month) + ' of Year ' + IntToStr(Year);
  SysUtils.DecodeTime(Present, Hour, Min, Sec, MSec);
  Label2.Caption := 'The time is Minute ' + IntToStr(Min) + ' of Hour '
    + IntToStr(Hour);
end;

No comments:

Post a Comment