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

#include <vcl.h>
#pragma hdrstop

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

// BeginCode
/*
The following code retrieves the current date and time using
the Windows GetLocalTime API call, and converts this value
to a TDateTime value.
*/
TDateTime __fastcall GetCurrentDateTime()
{
  SYSTEMTIME SystemTime;
  GetLocalTime(&SystemTime);
  return SystemTimeToDateTime(SystemTime);
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Label1->Caption = DateTimeToStr(GetCurrentDateTime());
}
// EndCode
// EndExample: SystemTimeToDateTime
//---------------------------------------------------------------------------
