mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-14 13:20:48 +00:00
CLIFormatter - implement renderer for timestamps using GMT
This commit is contained in:
parent
1c096521f7
commit
e735d7b015
@ -20,6 +20,15 @@ sub render_timestamp {
|
|||||||
|
|
||||||
PVE::JSONSchema::register_renderer('timestamp', \&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 {
|
sub render_duration {
|
||||||
my ($duration_in_seconds) = @_;
|
my ($duration_in_seconds) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user