projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1c09652
)
CLIFormatter - implement renderer for timestamps using GMT
author
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 5 Jul 2018 06:48:03 +0000
(08:48 +0200)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Thu, 5 Jul 2018 06:48:03 +0000
(08:48 +0200)
src/PVE/CLIFormatter.pm
patch
|
blob
|
history
diff --git
a/src/PVE/CLIFormatter.pm
b/src/PVE/CLIFormatter.pm
index
549ed31
..
052ed6d
100644
(file)
--- a/
src/PVE/CLIFormatter.pm
+++ b/
src/PVE/CLIFormatter.pm
@@
-20,6
+20,15
@@
sub render_timestamp {
PVE::JSONSchema::register_renderer('timestamp', \&render_timestamp);
+sub render_timestamp_gmt {
+ my ($epoch) = @_;
+
+ # ISO 8601 date format, standard Greenwich time zone
+ return strftime("%F %H:%M:%S", gmtime($epoch));
+}
+
+PVE::JSONSchema::register_renderer('timestamp_gmt', \&render_timestamp_gmt);
+
sub render_duration {
my ($duration_in_seconds) = @_;