Adding a verbose time option to output formatted timestamps

Fixes #11413

Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
This commit is contained in:
Dave Henderson 2015-04-07 20:37:36 -04:00 committed by Arnaud Porterie
parent 17ef617c77
commit dcff07d03d
1 changed files with 2 additions and 2 deletions

View File

@ -46,11 +46,11 @@ func (cli *DockerCli) CmdHistory(args ...string) error {
fmt.Fprintf(w, stringid.TruncateID(entry.ID))
}
if !*quiet {
fmt.Fprintf(w, "\t%s ago\t", units.HumanDuration(time.Now().UTC().Sub(time.Unix(entry.Created, 0))))
if *noTrunc {
fmt.Fprintf(w, "\t%s\t", time.Unix(entry.Created, 0).Format(time.RFC3339))
fmt.Fprintf(w, "%s\t", entry.CreatedBy)
} else {
fmt.Fprintf(w, "\t%s ago\t", units.HumanDuration(time.Now().UTC().Sub(time.Unix(entry.Created, 0))))
fmt.Fprintf(w, "%s\t", stringutils.Truncate(entry.CreatedBy, 45))
}
fmt.Fprintf(w, "%s\t", units.HumanSize(float64(entry.Size)))