[fpc-pascal] DefaultFormatSettings usage

silvioprog silvioprog at gmail.com
Tue Feb 4 14:54:25 CET 2014


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.

What am I doing wrong?

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20140204/ddf50b14/attachment.html>


More information about the fpc-pascal mailing list