summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-01 14:40:18 +0100
committerGitHub <noreply@github.com>2020-12-01 14:40:18 +0100
commit24383906f891cea0c802f911deed43f8f8f2ac85 (patch)
treeed5d88792a902c311374241ae80256d5b1bf7d37 /cmd/podman
parent9ae12f84e8d4704fe4c303fdedb12be8e4e73f59 (diff)
parent2d861ac14ad5b677717f357bd57c3f56f06307d5 (diff)
downloadpodman-24383906f891cea0c802f911deed43f8f8f2ac85.tar.gz
podman-24383906f891cea0c802f911deed43f8f8f2ac85.tar.bz2
podman-24383906f891cea0c802f911deed43f8f8f2ac85.zip
Merge pull request #8427 from rhatdan/ps
Handle ps container created field as a time.Time
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/containers/ps.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go
index 6f84cf9b8..5d08e6163 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -144,7 +144,7 @@ func checkFlags(c *cobra.Command) error {
func jsonOut(responses []entities.ListContainer) error {
r := make([]entities.ListContainer, 0)
for _, con := range responses {
- con.CreatedAt = units.HumanDuration(time.Since(time.Unix(con.Created, 0))) + " ago"
+ con.CreatedAt = units.HumanDuration(time.Since(con.Created)) + " ago"
con.Status = psReporter{con}.Status()
r = append(r, con)
}
@@ -404,12 +404,12 @@ func (l psReporter) Ports() string {
// CreatedAt returns the container creation time in string format. podman
// and docker both return a timestamped value for createdat
func (l psReporter) CreatedAt() string {
- return time.Unix(l.Created, 0).String()
+ return l.Created.String()
}
// CreateHuman allows us to output the created time in human readable format
func (l psReporter) CreatedHuman() string {
- return units.HumanDuration(time.Since(time.Unix(l.Created, 0))) + " ago"
+ return units.HumanDuration(time.Since(l.Created)) + " ago"
}
// Cgroup exposes .Namespaces.Cgroup