cli/command: fix ContainerFormat's CreatedAt docstring and add CreatedAtTimestamp

Signed-off-by: Jonathan Rasmussen <contact@jonathanjrasmussen.com>
This commit is contained in:
Jonathan Rasmussen 2023-06-26 18:29:17 -07:00
parent 605942cb2c
commit 2f196aae97
1 changed files with 6 additions and 1 deletions

View File

@ -189,11 +189,16 @@ func (c *ContainerContext) Command() string {
return strconv.Quote(command)
}
// CreatedAt returns the "Created" date/time of the container as a unix timestamp.
// CreatedAt returns the "Created" date/time of the container as a stringified unix timestamp.
func (c *ContainerContext) CreatedAt() string {
return time.Unix(c.c.Created, 0).String()
}
// CreatedAtTimestamp returns the "Created" date/time of the container as a unix timestamp.
func (c *ContainerContext) CreatedAtTimestamp() time.Time {
return time.Unix(c.c.Created, 0)
}
// RunningFor returns a human-readable representation of the duration for which
// the container has been running.
//