PKGeorgiev / Delphi-JsonToDelphiClass

Generates Delphi Classes based on JSON string (Json To Delphi Class Generator / JSON Data Binding Tool)
MIT License
236 stars 122 forks source link

ISO8601 dates (like created_at) become string not TDateTime #3

Open Blm0423 opened 8 years ago

Blm0423 commented 8 years ago

Fantastic and useful program, just what I needed.

However when I test with your default input, ISO8601 dates are not converted to TDateTime, but String type. Latest version downloaded today.

PKGeorgiev commented 7 years ago

Can you give me an example JSON string?

talesferreira commented 5 years ago

Field's: "dataInclusao" or "dataCredenciado"
Example:

  {
    "httpCodeStatus":200,
    "status":"OK",
    "mensagemResposta":"Executado com sucesso!",
    "dataHora":"27/08/2019 15:19:28",
    "dtoResposta":{
      "quantidadeListaResposta":1,
      "quantidadeTotalRegistros":null,
      "listaResposta":[
        {
          "codigoNome":null,
          "handle":6892,
          "idEstado":13,
          "estados":"MATO GROSSO DO SUL",
          "idMunicipio":3888,
          "nomeMunicipio":"CAMPO GRANDE",
          "codigoPrestador":"00001471",
          "nome":"LEONARDO",
          "fantasia":"LEONARDO",
          "fisicaJuridica":1,
          "cpfCnpj":"12345678912",
          "dataInclusao":1014091200000,
          "dataCredenciado":1014091200000,
          "dataDescredenciado":null,
          "convenioReciprocidade":"N",
          "categoria":4,
          "cbo":58585858,
          "celular":"123456789",
          "cnes":"9999999",
          "codigoFornecedor":"00009999",
          "conselhoRegional":"CRM",
          "conselhoRegionalCodigoTiss":"06",
          "ufCr":"MS",
          "inscricaoCr":"333",
          "redePropria":"N",
          "dataPrimeiroCredenc":1014091200000,
          "cooperativa":"N",
          "tipoPrestador":7,
          "localExecucao":"S",
          "solicitante":"S",
          "executante":"S",
          "recebedor":"S",
          "email":"CASSEMS@CASSEMS.COM.BR",
          "corpoClinico":"N",
          "idConselhoRegional":7,
          "descricaoCbo":null,
          "estruturaCbo":null,
          "ksolicitarTerceiro":"N",
          "kexecutarTerceiro":"N",
          "knecessitaCartao":"N",
          "ksolicitarTerceiroLista":null,
          "kexecutarTerceiroLista":null
        }
      ]
    },
    "dtoExBo":null,
    "extraInfo":{
      "mainClass":{
        "type":null,
        "classSchema":"br.com.ptd.dto.conectividade.prestador.DtoSamPrestador",
        "parent":null,
        "validation":null
      }
    }
  }
PKGeorgiev commented 5 years ago

@talesferreira "1014091200000", "1014091200000" and "27/08/2019 15:19:28" are not valid ISO8601 dates/times. Valid is for example: 2019-08-29T15:33:15