From b0d3fcc672c2ae9348475eae6d6919eb8608bf22 Mon Sep 17 00:00:00 2001 From: Felix Stupp Date: Sun, 6 Oct 2019 12:14:41 +0200 Subject: [PATCH] ping: Changed date output format to ISO --- routes/ping.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/ping.js b/routes/ping.js index 5ccce0b..d98000c 100644 --- a/routes/ping.js +++ b/routes/ping.js @@ -1,5 +1,6 @@ let express = require("express"); let ipaddr = require("ipaddr.js"); +let moment = require("moment"); let db = require("../libs/Database").instance(); let router = express.Router(); @@ -35,9 +36,9 @@ router.get("/:fqdn", (req, res) => { if (!d) return res.status(404).send("Unknown FQDN"); res.send([ d.ipv4 ? d.ipv4 : "0.0.0.0", - d.ipv4LastPing, + moment(d.ipv4LastPing).toISOString(), d.ipv6 ? d.ipv6 : "::", - d.ipv6LastPing, + moment(d.ipv6LastPing).toISOString(), ].reduce((a, b) => a + "\n" + b)); }); });