diff --git a/Pkg.Json.Mapper.pas b/Pkg.Json.Mapper.pas index 641e6fc..6d89f54 100644 --- a/Pkg.Json.Mapper.pas +++ b/Pkg.Json.Mapper.pas @@ -441,7 +441,7 @@ function TPkgJsonMapper.GetJsonType(AJsonValue: TJsonValue): TJsonType; if AJsonValue is TJSONString then begin LJsonString := (AJsonValue as TJSONString); - if TRegEx.IsMatch(LJsonString.Value, '^([0-9]{4})-?(1[0-2]|0[1-9])-?(3[01]|0[1-9]|[12][0-9])(T| )(2[0-3]|[01][0-9]):?([0-5][0-9]):?([0-5][0-9])$') then + if TRegEx.IsMatch(LJsonString.Value, '^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])T(2[0-3]|[01][0-9]):([0-5][0-9]):([0-5][0-9])(\.[0-9]+)?(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$') then result := jtDateTime else if TRegEx.IsMatch(LJsonString.Value, '^([0-9]{4})(-?)(1[0-2]|0[1-9])\2(3[01]|0[1-9]|[12][0-9])$') then