Skip to content

DateTime field in JObject Deserialization #99

@alana1

Description

@alana1

Hello,

I have a changefeed and returns JObject. In the JObject contains the DateTime field. However, the JObject returns the epoch time. When deserializing JObject to strongly type object, any properties with DateTime epoch time is not converted to the original datetime utc format we are expecting. How can I deserialize the jobject and return correct datetime. A sample of the json is below.

{
  "ChatQueueId": 1,
  "ChatRequestNo": 0,
  "DeliveredTime": {
    "$reql_type$": "TIME",
    "epoch_time": -62135596800,
    "timezone": "+00:00"
  },
  "EmailAddress": "mham@ctintegrations.com",
  "EndTime": {
    "$reql_type$": "TIME",
    "epoch_time": 1472074019.588,
    "timezone": "+00:00"
  },
  "EstablishedTime": {
    "$reql_type$": "TIME",
    "epoch_time": -62135596800,
    "timezone": "+00:00"
  },
  "FirstName": "Jerry",
  "InitialMessage": null,
  "KeyValues": [
    {
      "Key": "defid",
      "Value": "5454564"
    },
    {
      "Key": "defid",
      "Value": "5454564"
    },
    {
      "Key": "defid",
      "Value": "5454564"
    }
  ],
  "LastName": "McGiver",
  "RequestTime": {
    "$reql_type$": "TIME",
    "epoch_time": 1472070419.588,
    "timezone": "+00:00"
  },
  "SiteId": 0,
  "id": "70f6d8a0-4375-41f1-9db9-129683b7f3a1"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions