<div dir="ltr">Yes, I know, you are right, so far I've used DOS utility GetDate/GetTime without any errors.<div><br></div><div>I wanted to update the old compiler 1.x to the new version, but it seems will stay with the old version.<br>

<div><br></div><div>Thank you for your help.</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 17, 2013 at 8:31 PM, Tomas Hajny <span dir="ltr"><<a href="mailto:XHajT03@hajny.biz" target="_blank">XHajT03@hajny.biz</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, September 17, 2013 20:22, Lubomír Čabla wrote:<br>
> It may be, but I tried to use EncodeDateTime with the same result:<br>
><br>
> DT1:=EncodeDateTime(2013,5,28,15,26,1,0);<br>
> DT2:=EncodeDateTime(2013,5,28,15,27,1,0);<br>
><br>
> Function EncodeDateTime calls TryEncodeDateTime that uses TryEncodeDate<br>
> and<br>
> TryEncodeTime.<br>
><br>
> This is only a test, I want to be sure that after comparing the two values<br>
> get the correct time difference and 59 seconds is not correct.<br>
<br>
</div>As a principle, you can never avoid such errors if using floating point<br>
numbers. If you need absolutely precise results, use integers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tomas<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On Tue, Sep 17, 2013 at 6:15 PM, Bart <<a href="mailto:bartjunk64@gmail.com">bartjunk64@gmail.com</a>> wrote:<br>
><br>
>> On 9/17/13, Lubomír Čabla <<a href="mailto:kladno@gmail.com">kladno@gmail.com</a>> wrote:<br>
>> > I am doing something wrong?<br>
>><br>
>> Probably rounding errors:<br>
>>   DT1:=EncodeDate(2013,5,28)+EncodeTime(15,26,1,0);<br>
>> 2 calculations on floating numbers<br>
>><br>
>>   DT1:=EncodeTime(15,26,1,0);<br>
>> 1 calculation on floating numbers<br>
>><br>
>> Bart<br>
>> _______________________________________________<br>
>> fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
>> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
>><br>
> _______________________________________________<br>
> fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
> <a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
<br>
<br>
_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</div></div></blockquote></div><br></div>