Hi,

Στις 4/2/2014 3:54 μμ, ο/η silvioprog έγραψε:
Hello,

I'm using this configuration:

initialization
DefaultFormatSettings.DateSeparator := '-';
DefaultFormatSettings.TimeSeparator := ':';
DefaultFormatSettings.ShortDateFormat := 'yyyy-mm-dd';
DefaultFormatSettings.ShortTimeFormat := 'hh:nn:ss';

but, when i try:

var
t: TDateTime;
begin
t := StrToDate('2013-02-04 11:39:54'); // to format yyyy-mm-dd hh:nn:ss
end;

result: "2013-02-04 11:39:54" is not a valid date format.

Try the overload StrToDate(S, DefaultFormatSettings), or better declare a FFormatSettings: TFormatSettings setup it as you like pass that to the StrToDate leaving the DefaultFormatSettings.

Regards,

--
Dimitrios Chr. Ioannidis
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to