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