|
VCL 도움말에 보니 DateTime은 매번 서버에서 값을 가져오는듯 하군요. 그렇다면 매번 변해야죠..
TIdTime.DateTime 도움말:
Current date and time from the server.
property DateTime: TDateTime;
Description
DateTime is a read-only TDateTime property that reflects the estimated current date and time according to a Time server. DateTime is expressed in the timezone for the local computer.
DateTime will contain the value 0.0 (for 12/30/1899 12:00 am) when no date and time values have been assigned.
The Host and Port properties must contain a valid Time server address and port assignment prior to accessing the value of DateTime.
아야 님이 쓰신 글 :
: Timer에서 스탭 실행을 했는데..IdTime1->DateTime값이 변하는데 왜 그런거에요????
: 스탭실행 할 경우에는 또 다시 스탭실행 할 때까진 값이 변하지 않는게 당연한거 아닌가요??
: 어디서 이 값을 가지고 오는지도 모르겠습니다...
: 도와주세요..... 일주일 내내 하고 있습니다.... ㅠ ㅠ;
:
: void __fastcall TForm1::Timer1Timer(TObject *Sender)
: {
: TDateTime *datetime;
:
: try
: {
: datetime->Val = IdTime1->DateTime; // 브레이크 걸어서 확인했는데 값이 자꾸 변함..
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
: if ( datetime->Val != 0) {
: Label1->Caption = DateTimeToStr( datetime->Val);
: }
: // 에러 처리
: }catch ( Exception &e) {
: IdTime1->Disconnect();
: Edit1->Text = e.Message;
: }catch (...) {
: Edit1->Text = "Time Server Error.";
: IdTime1->Disconnect();
: }
: }
|