[pve-devel] [pve-common 1/4] use new timestamp renderer for /nodes/<nodename>/time

Dietmar Maurer dietmar at proxmox.com
Wed Jul 11 11:19:42 CEST 2018


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/API2/Nodes.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index bc29f703..5ba1002d 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1115,11 +1115,13 @@ __PACKAGE__->register_method({
 		description => "Seconds since 1970-01-01 00:00:00 UTC.",
 		type => 'integer',
 		minimum => 1297163644,
+		renderer => 'timestamp',
 	    },
 	    localtime => {
 		description => "Seconds since 1970-01-01 00:00:00 (local time)",
 		type => 'integer',
 		minimum => 1297163644,
+		renderer => 'timestamp_gmt',
 	    },
         },
     },
@@ -1130,7 +1132,7 @@ __PACKAGE__->register_method({
 	my $ltime = timegm_nocheck(localtime($ctime));
 	my $res = {
 	    timezone => PVE::INotify::read_file('timezone'),
-	    time => time(),
+	    time => $ctime,
 	    localtime => $ltime,
 	};
 
-- 
2.11.0




More information about the pve-devel mailing list