Format options - showing dates

I’ve been reading the drone cli docs, which mention a --format flag

❯ drone build help ls
   drone build ls - show build history

   drone build ls [command options] <repo/name>

   --format value  format output (default: "\x1b[33mBuild #{{ .Number }} \x1b[0m\nStatus: {{ .Status }}\nEvent: {{ .Event }}\nCommit: {{ .After }}\nBranch: {{ .Target }}\nRef: {{ .Ref }}\nAuthor: {{ .Author }} {{ if .AuthorEmail }}<{{.AuthorEmail}}>{{ end }}\nMessage: {{ .Message }}\n")
   --branch value  branch filter
   --event value   event filter
   --status value  status filter
   --limit value   limit the list size (default: 25)
   --page value    page number (default: 1)

I’d really like to display the date of events - is there an option for that? I’ve searched the docs, the forum, tried .Date all to no avail. Any ideas?

Thanks, Sam


Looking into repo drone-cli/build_info.go at master · drone/drone-cli · GitHub Could not see Date field present.
Alternatively you can make api request which has “started”, “finished”, “created”,“updated”:
Build List | Drone

the date is stored in the .Created field

drone build ls [repository] --format="{{ .Number }} {{ .Status}} {{time .Created}}"

thanks, that works, although for some reason on my zsh the format loses all the escape characters making everything difficult to read :frowning: