@Alberto Paganini You need const in the parameter list, also measure with TStopwatch and not with Now(), and try not to use local string variable, like:
function JsonStringToDateTime(const Src: string): TDateTime;
const
ofs = Ord('0');
var
pSrc: PChar;
Time: TDateTime;
begin
if Length(Src) < 19 then
Exit(gOutOfScopelDate);
pSrc := Pointer(Src);
if not TryEncodeDate( //
((Ord((pSrc)^) - ofs) * 1000) + ((Ord((pSrc + 1)^) - ofs) * 100) + ((Ord((pSrc + 2)^) - ofs) * 10) + (Ord((pSrc + 3)^) - ofs), //
((Ord((pSrc + 5)^) - ofs) * 10) + (Ord((pSrc + 6)^) - ofs), //
((Ord((pSrc + 8)^) - ofs) * 10) + (Ord((pSrc + 9)^) - ofs), Result) then
Exit(gOutOfScopelDate);
if not TryEncodeTime( //
((Ord((pSrc + 11)^) - ofs) * 10) + (Ord((pSrc + 12)^) - ofs), //
((Ord((pSrc + 14)^) - ofs) * 10) + (Ord((pSrc + 15)^) - ofs), //
((Ord((pSrc + 17)^) - ofs) * 10) + (Ord((pSrc + 18)^) - ofs), //
0, //
Time) then
Exit(gOutOfScopelDate);
Result := Result + Time;
end;