2014-02-04 Dimitrios Chr. Ioannidis <d.ioanni...@nephelae.eu>: > 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
Thank you Dimitrios! Worked with: var t: TDateTime; begin t := StrToDateTime('2013-02-04 11:39:54'); end; sorry, I forgot to use the function StrToDateTime. :S -- Silvio Clécio My public projects - github.com/silvioprog
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal