From 82a01cbddac4eb9f4f8d17e66e5929374012322e Mon Sep 17 00:00:00 2001 From: Crazykev Date: Wed, 16 Nov 2016 15:36:32 +0800 Subject: [PATCH] fix ocic time display Signed-off-by: Crazykev --- cmd/client/container.go | 8 ++++---- cmd/client/sandbox.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/client/container.go b/cmd/client/container.go index c70388b9..6e1b6086 100644 --- a/cmd/client/container.go +++ b/cmd/client/container.go @@ -376,15 +376,15 @@ func ContainerStatus(client pb.RuntimeServiceClient, ID string) error { fmt.Printf("Status: %s\n", r.Status.State) } if r.Status.CreatedAt != nil { - ctm := time.Unix(*r.Status.CreatedAt, 0) + ctm := time.Unix(0, *r.Status.CreatedAt) fmt.Printf("Created: %v\n", ctm) } if r.Status.StartedAt != nil { - stm := time.Unix(*r.Status.StartedAt, 0) + stm := time.Unix(0, *r.Status.StartedAt) fmt.Printf("Started: %v\n", stm) } if r.Status.FinishedAt != nil { - ftm := time.Unix(*r.Status.FinishedAt, 0) + ftm := time.Unix(0, *r.Status.FinishedAt) fmt.Printf("Finished: %v\n", ftm) } if r.Status.ExitCode != nil { @@ -448,7 +448,7 @@ func ListContainers(client pb.RuntimeServiceClient, opts listOptions) error { fmt.Printf("Status: %s\n", *c.State) } if c.CreatedAt != nil { - ctm := time.Unix(*c.CreatedAt, 0) + ctm := time.Unix(0, *c.CreatedAt) fmt.Printf("Created: %v\n", ctm) } if c.Labels != nil { diff --git a/cmd/client/sandbox.go b/cmd/client/sandbox.go index 0e547281..a77463a0 100644 --- a/cmd/client/sandbox.go +++ b/cmd/client/sandbox.go @@ -292,7 +292,7 @@ func PodSandboxStatus(client pb.RuntimeServiceClient, ID string) error { fmt.Printf("Status: %s\n", r.Status.State) } if r.Status.CreatedAt != nil { - ctm := time.Unix(*r.Status.CreatedAt, 0) + ctm := time.Unix(0, *r.Status.CreatedAt) fmt.Printf("Created: %v\n", ctm) } if r.Status.Linux != nil { @@ -366,7 +366,7 @@ func ListPodSandboxes(client pb.RuntimeServiceClient, opts listOptions) error { } } fmt.Printf("Status: %s\n", pod.State) - ctm := time.Unix(*pod.CreatedAt, 0) + ctm := time.Unix(0, *pod.CreatedAt) fmt.Printf("Created: %v\n", ctm) if pod.Labels != nil { fmt.Println("Labels:")