Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes

## master

* Print dates in local time

## v1.2.0

* Update hcloud library to v1.2.0 fixing rate limit check
Expand Down
2 changes: 1 addition & 1 deletion image_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func runImageDescribe(cli *CLI, cmd *cobra.Command, args []string) error {
fmt.Printf("Image size:\t%s\n", na(""))
}
fmt.Printf("Disk size:\t%.0f GB\n", image.DiskSize)
fmt.Printf("Created:\t%s (%s)\n", image.Created, humanize.Time(image.Created))
fmt.Printf("Created:\t%s (%s)\n", datetime(image.Created), humanize.Time(image.Created))
fmt.Printf("OS flavor:\t%s\n", image.OSFlavor)
fmt.Printf("OS version:\t%s\n", na(image.OSVersion))
fmt.Printf("Rapid deploy:\t%s\n", yesno(image.RapidDeploy))
Expand Down
4 changes: 2 additions & 2 deletions server_describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func runServerDescribe(cli *CLI, cmd *cobra.Command, args []string) error {
fmt.Printf("ID:\t\t%d\n", server.ID)
fmt.Printf("Name:\t\t%s\n", server.Name)
fmt.Printf("Status:\t\t%s\n", server.Status)
fmt.Printf("Created:\t%s (%s)\n", server.Created, humanize.Time(server.Created))
fmt.Printf("Created:\t%s (%s)\n", datetime(server.Created), humanize.Time(server.Created))

fmt.Printf("Server Type:\t%s (ID: %d)\n", server.ServerType.Name, server.ServerType.ID)
fmt.Printf(" ID:\t\t%d\n", server.ServerType.ID)
Expand Down Expand Up @@ -80,7 +80,7 @@ func runServerDescribe(cli *CLI, cmd *cobra.Command, args []string) error {
fmt.Printf(" Image size:\t%s\n", na(""))
}
fmt.Printf(" Disk size:\t%.0f GB\n", image.DiskSize)
fmt.Printf(" Created:\t%s (%s)\n", image.Created, humanize.Time(image.Created))
fmt.Printf(" Created:\t%s (%s)\n", datetime(image.Created), humanize.Time(image.Created))
fmt.Printf(" OS flavor:\t%s\n", image.OSFlavor)
fmt.Printf(" OS version:\t%s\n", na(image.OSVersion))
fmt.Printf(" Rapid deploy:\t%s\n", yesno(image.RapidDeploy))
Expand Down
4 changes: 4 additions & 0 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func na(s string) string {
return s
}

func datetime(t time.Time) string {
return t.Local().Format(time.UnixDate)
}

func waitAction(ctx context.Context, client *hcloud.Client, action *hcloud.Action) (<-chan error, <-chan int) {
errCh := make(chan error, 1)
progressCh := make(chan int)
Expand Down