You are setting DateSeparator
before calling StrToDateTime()
(FYI, you should be using the TFormatSettings
overloaded version of StrToDateTime()
, not using the global System.SysUtils.FormatSettings
variable at all). Clearly the DateSeparator
did take effect to produce the Result
you have shown.
Your Result
is a TDateTime
, not a String
. If you are evaluating the Result
in the debugger, then setting the RTL's formatting variables at runtime has no effect on the debugger. If you are evaluating the Result
some other way, you did not show/explain how.