Explorar el 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 hace 10 años
padre
commit
dcff07d03d
Se han modificado 1 ficheros con 2 adiciones y 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)))