Why does anyone think there might be a $FF character in OP's source code?
If it were, fpc would probably choke on it if it were not in a string ("fatal: illegal character"), and if it were in a string (i.e. between single quotes), how would that possibly affect the behaviour of the example code, since OP does not do any conversion of string into whatever?
What is the output of
var
S: ShortString;
T: TDateTime;
...
writeln('TimeSeparator = ',TimeSeparator);
writeln('LongTimeFormat = ',LongTimeFormat);
TimeSeparator := ':';
LongTimeFormat := 'hh:mm:ss';
T := Time;
DeCodeTime (T,Hh,MM,SS,MS);
Writeln ('Present Time is : ',FormatDateTime('hh:mm:ss',EnCodeTime (HH,MM,SS,MS)));
S := TimeToStr(T);
writeln('Prova: "',S,'"');
Bart