<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<blockquote type="cite"
cite="mid:Pine.LNX.4.64.1806141219080.1334@ijon">You also can make
your own procedure to fix the issue for yourself.
<br>
Like you can rewrite the function StrToDateTime() to change all '.
' to '.' and then call the original function StrToDateTime()
<br>
</blockquote>
Of course it is possible, but IMO it should be fixed in general way.
I have reported bug #33860<br>
I can prepare think about patch, but I must know what situations,
formats must be supported by SplitDateTimeStr() and what is expected
output.<br>
(this should be documented is source code)<br>
L.<br>
<br>
<blockquote type="cite"
cite="mid:Pine.LNX.4.64.1806141219080.1334@ijon">
<br>
<br>
On Thu, 14 Jun 2018, LacaK wrote:
<br>
<br>
<blockquote type="cite">Hi,
<br>
<br>
now I am migrating my applications from FPC 2.6.4 to FPC 3.0.4
and I noticed that logic in function StrToDateTime() was
changed.
<br>
<br>
In 2.6.4 there was first detected position of first
TimeSeparator and then walking back to first occurence of
WhiteSpace.
<br>
This approach allows DateSeparator='. ' (dot+space) which is for
example default settings in Windows7 in Slovak language
(TimeSeparator=':').
<br>
<br>
Now in FPC 3.0.4 firs occurence of space causes division of date
and time. It results in where:
<br>
'11. 07. 2018 13:00' is divided to date part = '11.' and time
part='07. 2018' which is wrong.
<br>
<br>
There is in FPC 3.0.4 new function SplitDateTimeStr():
<br>
...
<br>
//find separator
<br>
if (FS.DateSeparator<>#32) then
<br>
begin
<br>
while (p<Length(DateTimeStr)) and (not (DateTimeStr[p+1]
in WhiteSpace)) do
<br>
Inc(p);
<br>
end
<br>
else
<br>
begin
<br>
p:=Pos(FS.TimeSeparator, DateTimeStr);
<br>
if (p<>0) then
<br>
repeat
<br>
Dec(p);
<br>
until (p=0) or (DateTimeStr[p] in WhiteSpace);
<br>
end;
<br>
...
<br>
<br>
In first part of code is located first occurnce of white space,
which is also part of DateSeparator!
<br>
Can this be to fixed ?
<br>
<br>
L.
<br>
<br>
_______________________________________________
<br>
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br>
</blockquote>
<!--'"--><br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
fpc-pascal maillist - <a class="moz-txt-link-abbreviated" href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a></pre>
</blockquote>
<br>
</body>
</html>