align="justify"> # include Unit1.h
# include systdate.h
//---------------------------------------------------------------------------
# pragma package (smart_init)
# pragma resource *. dfm * Form1;
//---------------------------------------------------------------------------
__ fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Button1Click (TObject * Sender)
{DateTime=TDateTime :: CurrentDateTime (); week=DateTime.DayOfWeek ();
switch (week)
{
case 1: {Label1- gt; Caption= monday raquo ;; break;}
case 2: {Label1- gt; Caption= tuesday raquo ;; break;}
case 3: {Label1- gt; Caption= wednesday raquo ;; break;}
case 4: {Label1- gt; Caption= thursday raquo ;; break;}
case 5: {Label1- gt; Caption= friday raquo ;; break;}
case 6: {Label1- gt; Caption= saturday raquo ;; break;}
case 7: {Label1- gt; Caption= sunday raquo ;; break;}
} - gt; Caption= DateTime + DateTime.DateTimeString (); - gt; Caption= Date + DateTime.DateString (); - gt; Caption= Time + DateTime.TimeString ();=TDateTime :: FileDateToDateTime (FileAge (Application- gt; ExeName)); - gt; Caption= data and time of file: + DateTime.DateTimeString ();
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Button2Click (TObject * Sender)
{ gt; Terminate ();
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Button3Click (TObject * Sender)
{OldCursor=Screen- gt; Cursor;
Screen- gt; Cursor=crHourGlass;
TDateTime StartDateTime=TDateTime :: CurrentDateTime (); (int i=0; i lt; 500000; i ++)
{(TDateTime :: CurrentDateTime (). DateTimeString ()); gt; ProcessMessages ();
} EndDateTime=TDateTime :: CurrentDateTime (); gt; Cursor=OldCursor; - gt; Caption=(EndDateTime - StartDateTime) .TimeString ();
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Button4Click (TObject * Sender)
{TDateTime DateTime=TDateTime :: CurrentDateTime ();
Label7- gt; Caption=(DateTime ++). DateTimeString ();
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Button5Click (TObject * Sender)
{TDateTime DateTime=TDateTime :: CurrentDateTime (); - gt; Caption=(DateTime +=1.125) .DateTimeString ();
}
//---------------------------------------------------------------------------__fastcall TForm1 :: Timer1Timer (TObject * Sender)
{String TimeFormat, DateFormat; (CheckBox1- gt; Checked)
DateFormat= dddddd raquo ;;
else
DateFormat= ddddd raquo ;; (CheckBox2- gt; Checked)= hh: nn: ss raquo ;;
else= hh: nn raquo ;; - gt; Caption=TDateTime :: CurrentDateTime (). FormatString (DateFormat + TimeFormat);
}
//---------------------------------------------------------------------------__fastcall TForm1 :: CheckBox1Click (TObject * Sender)
{(CheckBox1- gt; Checked)
Label9- gt; Caption=TDateTime :: CurrentDateTime (). FormatString ( dddddd: hh: nn );
else
Label9- gt; Caption=TDateTime :: CurrentDateTime (). FormatString ( ddddd: hh: nn );
}
//---------------------------------------------------------------------------__fastcall TForm1 :: CheckBox2Click (TObject * Sender)
{(CheckBox2- gt; Checked)
Label9- gt; Caption=TDateTime :: CurrentDateTime (). FormatString ( dd.mm.yy.hh: nn: ss );//TimeFormat= hh: nn: ss raquo ;;
else- gt; Caption=TDateTime :: CurrentDateTime (). FormatString ( dd.mm.yy.hh: nn );//TimeFormat= hh: nn raquo ;;
...