<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-02-04 Dimitrios Chr. Ioannidis <span dir="ltr"><<a href="mailto:d.ioannidis@nephelae.eu" target="_blank">d.ioannidis@nephelae.eu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hi,<br>
<br>
Στις 4/2/2014 3:54 μμ, ο/η silvioprog έγραψε:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello,<br>
<br>
I'm using this configuration:<br>
<br>
initialization<br>
DefaultFormatSettings.<u></u>DateSeparator := '-';<br>
DefaultFormatSettings.<u></u>TimeSeparator := ':';<br>
DefaultFormatSettings.<u></u>ShortDateFormat := 'yyyy-mm-dd';<br>
DefaultFormatSettings.<u></u>ShortTimeFormat := 'hh:nn:ss';<br>
<br>
but, when i try:<br>
<br>
var<br>
t: TDateTime;<br>
begin<br>
t := StrToDate('2013-02-04 11:39:54'); // to format yyyy-mm-dd hh:nn:ss<br>
end;<br>
<br>
result: "2013-02-04 11:39:54" is not a valid date format.<br>
</blockquote>
<br></div>
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.<br>
<br>
Regards,<span class=""><font color="#888888"><br>
<br>
-- <br>
Dimitrios Chr. Ioannidis</font></span></blockquote></div><div><br></div><div>Thank you Dimitrios!</div><div><br></div><div>Worked with:</div><div><br></div><div><div>var</div><div> t: TDateTime;</div><div>begin</div><div>
t := StrToDateTime('2013-02-04 11:39:54');</div><div>end;</div></div><div><br></div><div>sorry, I forgot to use the function StrToDateTime. :S<br></div><div><br></div>-- <br>Silvio Clécio<br>My public projects - <a href="http://github.com/silvioprog" target="_blank">github.com/silvioprog</a>
</div></div>