Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 352 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 352 Bytes

go-duration

go-duration is a gem which provides compatibility with Golang's time.Duration type strings.

Examples

From Golang's time.Duration:

d = GoDuration.parse("1m30s")
d.seconds
> 90

To Golang's time.Duration:

d = GoDuration::Duration.new(90)
d.to_s
> "1m30s"