From 87c8a780fa6f9abd3aedc39c7e31e27e768e1477 Mon Sep 17 00:00:00 2001 From: cp6 Date: Sun, 26 Nov 2023 22:26:18 +1100 Subject: [PATCH] Added parsed_at key and value to JSON output --- README.md | 3 ++- src/NetworkSpeed.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15ee4f8..ccaf6ff 100644 --- a/README.md +++ b/README.md @@ -454,6 +454,7 @@ as JSON: "total_data_value": 269.77, "total_data_unit": "GB", "duration": "00:13:13" - } + }, + "parsed_at" : "2023-11-25 20:55:43" } ``` diff --git a/src/NetworkSpeed.php b/src/NetworkSpeed.php index 450525b..fdbb361 100644 --- a/src/NetworkSpeed.php +++ b/src/NetworkSpeed.php @@ -221,7 +221,8 @@ public function asJson(): array 'total_data_value' => (float)$totalDataMatches[1], 'total_data_unit' => $totalDataMatches[2], 'duration' => gmdate("H:i:s", ($durationMatches[1] * 60) + $durationMatches[2]) - ] + ], + 'parsed_at' => date('Y-m-d H:i:s') ]; }