Explorar o código

Adding a verbose time option to output formatted timestamps

Fixes #11413

Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
Dave Henderson %!s(int64=10) %!d(string=hai) anos
pai
achega
dcff07d03d
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      api/client/history.go

+ 2 - 2
api/client/history.go

@@ -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)))