[#1074] neofs-cli: Move PrettyPrintUnixTime
to the common
package
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
b432558aaa
commit
736e09a70d
3 changed files with 17 additions and 13 deletions
|
@ -755,7 +755,7 @@ func prettyPrintContainer(cmd *cobra.Command, cnr *container.Container, jsonEnco
|
|||
cmd.Printf("attribute: %s=%s (%s)\n",
|
||||
attribute.Key(),
|
||||
attribute.Value(),
|
||||
prettyPrintUnixTime(attribute.Value()))
|
||||
common.PrettyPrintUnixTime(attribute.Value()))
|
||||
|
||||
continue
|
||||
}
|
||||
|
@ -788,14 +788,3 @@ func prettyPrintBasicACL(cmd *cobra.Command, basicACL acl.BasicACL) {
|
|||
}
|
||||
cmd.Println()
|
||||
}
|
||||
|
||||
func prettyPrintUnixTime(s string) string {
|
||||
unixTime, err := strconv.ParseInt(s, 10, 64)
|
||||
if err != nil {
|
||||
return "malformed"
|
||||
}
|
||||
|
||||
timestamp := time.Unix(unixTime, 0)
|
||||
|
||||
return timestamp.String()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue