Help us shape the future of Go! Take the 2026 Go Developer Survey

moretime

package
v0.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Day = 24 * time.Hour
View Source
const HalfYear = 6 * Month
View Source
const Month = 30 * Day
View Source
const Quarter = 3 * Month
View Source
const Week = 7 * Day
View Source
const Year = 365 * Day

Variables

This section is empty.

Functions

func ConvertFromFancyTime

func ConvertFromFancyTime(fancy string) time.Duration

Converts the following to time.Duration:

"1y" -> 1 year,
"2M" -> 2 months,
"3w" -> 3 weeks,
"4d" -> 4 days,
"5h" -> 5 hours,
"6m" -> 6 minutes,
"7s" -> 7 seconds,
"8"-> 8 milliseconds

func ConvertToFancyTime

func ConvertToFancyTime(d time.Duration) string

Converts to milliseconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL