I thought I'd get feedback here before I log this as a bug:<br><br>==================================================<br>program Project1;<br><br>uses<br> Classes,<br> SysUtils,<br> DateUtils;<br><br>var<br> utime : longword;<br>
currentDt : TDateTime;<br> convertedDt : TDateTime;<br>begin<br> currentDt := EncodeDateTime(1989, 9, 16, 12, 0, 0, 0);<br> utime := DateTimeToUnix(currentDt);<br> convertedDt := UnixToDateTime(utime);<br> writeln(FormatDateTime('mm/dd/yyyy HH:nn:ss', currentDt) + ' = ' +<br>
IntToStr(utime) + ' = ' +<br> FormatDateTime('mm/dd/yyyy HH:nn:ss', convertedDt));<br><br> currentDt := EncodeDateTime(1989, 9, 16, 12, 0, 1, 0);<br> utime := DateTimeToUnix(currentDt);<br>
convertedDt := UnixToDateTime(utime);<br> writeln(FormatDateTime('mm/dd/yyyy HH:nn:ss', currentDt) + ' = ' +<br> IntToStr(utime) + ' = ' +<br> FormatDateTime('mm/dd/yyyy HH:nn:ss', convertedDt));<br>
<br> currentDt := EncodeDateTime(1989, 9, 16, 12, 0, 2, 0);<br> utime := DateTimeToUnix(currentDt);<br> convertedDt := UnixToDateTime(utime);<br> writeln(FormatDateTime('mm/dd/yyyy HH:nn:ss', currentDt) + ' = ' +<br>
IntToStr(utime) + ' = ' +<br> FormatDateTime('mm/dd/yyyy HH:nn:ss', convertedDt));<br>end.<br>==================================================<br><br>The output I get (fpc 2.2.2 on linux) is:<br>
<br>09-16-1989 12:00:00 = 621950400 = 09-16-1989 12:00:00<br>09-16-1989 12:00:01 = 621950400 = 09-16-1989 12:00:00<br>09-16-1989 12:00:02 = 621950402 = 09-16-1989 12:00:02<br><br>It seems to me that 09-16-1989 12:00:01 should be 621950401, not 621950400.<br>
<br>Is this broken or am I missing something?<br><br>-sg<br><br clear="all">========================<br>Computer over. Virus = very yes.<br><br>Seth Grover<br>sethdgrover[at]gmail[dot]com<br>