//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "SysUtilsStrToTime.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
// BeginExample: SysUtilsStrToTime
// Routine: SysUtils.StrToTime

// BeginCode
/*
This example uses an edit box and a button on a form. When
the user enters a time in the edit box in the HH:MM:SS
format, the string entered is converted to a TDateTime value.
A message then appears that says "Good Morning" or "Good
Afternoon", depending on whether the time entered was in the
morning or afternoon.
*/
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  TDateTime dtTime = StrToTime(Edit1->Text);
  if (dtTime < (TDateTime) 0.50 )
    ShowMessage("Good Morning");
  else
    ShowMessage("Good Afternoon");
}
// EndCode
// EndExample: SysUtilsStrToTime
//---------------------------------------------------------------------------
