Skip to content
/ go-ms Public

Use this package to easily convert various time formats to milliseconds. This is a Go port of the Javascript ms library.

License

Notifications You must be signed in to change notification settings

zitudu/go-ms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ms

GoDoc rcard

Use this package to easily convert various time formats to milliseconds. This is a Go port of the Javascript ms library.

Install

Requires Go 1.11 and above. Run this command

go get github.com/zitudu/go-ms

Usage

import "github.com/zitudu/go-ms"

age, err := ms.Parse("30days") // 2592000000.000000
expiresIn := ms.MustParse("20 hrs") // 72000000.000000
ms.FormatShort(60000) // 1m
ms.FormatLong(-3 * 60000) // -3 minutes

License

MIT

About

Use this package to easily convert various time formats to milliseconds. This is a Go port of the Javascript ms library.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages