Gravity last updated info Arduino


#1

Displaying JSON output from /api.php/summary with Arduino works with next code:

void updateJSON() {
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(“http://192.168.2.xxx/admin/api.php?summary”);
int httpCode = http.GET();
if (httpCode > 0) {
const size_t bufferSize = JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE(8) + 370;
DynamicJsonBuffer jsonBuffer(bufferSize);
JsonObject& root = jsonBuffer.parseObject(http.getString());
int id = root[“id”];
const char* phPercent = root[“ads_percentage_today”];
const char* phBlocked = root[“ads_blocked_today”];
const char* phDomains = root[“domains_being_blocked”];
Serial.println(phPercent);
Serial.println(phBlocked);
Serial.println(phDomains);
}
http.end();
}

I can’t figure out how to complete the output with the gravity_last_updated info like days, hours and minutes. Can someone help me to solve this?