From 2f196aae97dea852a8ffa9c7045d9e439207bec4 Mon Sep 17 00:00:00 2001 From: Jonathan Rasmussen Date: Mon, 26 Jun 2023 18:29:17 -0700 Subject: [PATCH] cli/command: fix ContainerFormat's CreatedAt docstring and add CreatedAtTimestamp Signed-off-by: Jonathan Rasmussen --- cli/command/formatter/container.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/command/formatter/container.go b/cli/command/formatter/container.go index 22b144f98f..b74ef13df9 100644 --- a/cli/command/formatter/container.go +++ b/cli/command/formatter/container.go @@ -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. //