From ee373be9c80c10bebc1dbf642c2dc01b892fcd86 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 13 Mar 2015 15:46:37 -0700 Subject: [PATCH] print ./mc ls in a proper format --- cmd-ls.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd-ls.go b/cmd-ls.go index c5ea8aba..e36eaeef 100644 --- a/cmd-ls.go +++ b/cmd-ls.go @@ -26,9 +26,13 @@ import ( "github.com/minio-io/mc/pkg/s3" ) +const ( + printDate = "2006-01-02 15:04:05 -0700 MST" +) + func printBuckets(v []*s3.Bucket) { for _, b := range v { - msg := fmt.Sprintf("%v %9s %s", b.CreationDate.Local(), "", b.Name) + msg := fmt.Sprintf("%29s %13s %s", b.CreationDate.Local().Format(printDate), "", b.Name) info(msg) } } @@ -43,7 +47,7 @@ func printObjects(v []*s3.Item) { } func printObject(date time.Time, v int64, key string) { - msg := fmt.Sprintf("%v %9s %s", date.Local(), pb.FormatBytes(v), key) + msg := fmt.Sprintf("%29s %13s %s", date.Local().Format(printDate), pb.FormatBytes(v), key) info(msg) }