Skip to content

Commit

Permalink
Merge pull request #1 from brianvoe/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
davidbanham authored Mar 11, 2019
2 parents d0e112a + 1b10b66 commit 951fcf1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import "github.com/davidbanham/human_duration"

example := time.Hour * 25 + time.Minute * 4 + time.Second * 8

fmt.Println(human_duration.String(example, "second") // 1 day 4 minutes 8 seconds
fmt.Println(human_duration.String(example, "minute") // 1 day 4 minutes
fmt.Println(human_duration.String(example, "day") // 1 day
fmt.Println(human_duration.String(example, "second")) // 1 day 4 minutes 8 seconds
fmt.Println(human_duration.String(example, "minute")) // 1 day 4 minutes
fmt.Println(human_duration.String(example, "day")) // 1 day

day := time.Hour * 24
year := day * 365

longExample := year * 4 + day * 2

fmt.Println(human_duration.String(longExample, "second") // 4 years 2 days
fmt.Println(human_duration.String(longExample, "second")) // 4 years 2 days
```

There are more examples in the [tests](https://github.com/davidbanham/human_duration/blob/master/main_test.go).
Expand Down

0 comments on commit 951fcf1

Please sign in to comment.