I have a variable of type TTime and the value EncodeTime(17, 00, 00,00), when I try to get the double value I get 0.070833333333. I also have a datetimepicker component when I set it to 17:00:00 the double value I get is 0.70833333334. It is not the same as the one that I enconded, so Im facing an issue whenever I try to compare the two values to see if they are equal. Why would it be that I am getting this error? I don't know if this is an error, but they are supposed to have the same double value.
            Asked
            
        
        
            Active
            
        
            Viewed 49 times
        
    0
            
            
         
    
    
        LU RD
        
- 34,438
- 5
- 88
- 296
 
    
    
        Juan Felipe Gomez
        
- 99
- 1
- 2
- 8
- 
                    1Delphi version could very well be relevant. What is it? Sadly this is one of the great failings of the Delphi date/time format, the reliance on floating point rather than integer arithmetic. – David Heffernan Jul 04 '16 at 13:17
- 
                    Delphi Enterprise 7.0 – Juan Felipe Gomez Jul 04 '16 at 13:19
- 
                    1More recent versions have improved date support. All the same, you are probably going to need to compare the two values up to a tolerance, say half a second. – David Heffernan Jul 04 '16 at 13:21
- 
                    2See also [Comparing Time Values](http://stackoverflow.com/q/23990987/576719). – LU RD Jul 04 '16 at 13:29
- 
                    @David: fully agreed. It can't be too hard to leave the integral part as-is (for days) and use another integer for the milliseconds. Or whatever. – Rudy Velthuis Jul 05 '16 at 01:49