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

time

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 1 Imported by: 0

README

time

import "github.com/gechr/x/time"

Package time provides time helpers.

Example

The calendar-scaled durations compose with the standard time package.

fmt.Println(xtime.Day)
fmt.Println(xtime.Week)
fmt.Println(xtime.Year)

Output:

24h0m0s
168h0m0s
8760h0m0s

Index

Constants

Calendar-scaled durations beyond what the standard time package names. A day is 24 hours, a week is 7 days, and a year is 365 days, matching human.FormatDuration and human.ParseDuration.

const (
    Day  = 24 * time.Hour
    Week = 7 * Day
    Year = 365 * Day
)

Documentation

Overview

Package time provides time helpers.

Example

The calendar-scaled durations compose with the standard time package.

package main

import (
	"fmt"

	xtime "github.com/gechr/x/time"
)

func main() {
	fmt.Println(xtime.Day)
	fmt.Println(xtime.Week)
	fmt.Println(xtime.Year)
}
Output:
24h0m0s
168h0m0s
8760h0m0s

Index

Examples

Constants

View Source
const (
	Day  = 24 * time.Hour
	Week = 7 * Day
	Year = 365 * Day
)

Calendar-scaled durations beyond what the standard time package names. A day is 24 hours, a week is 7 days, and a year is 365 days, matching github.com/gechr/x/human.FormatDuration and github.com/gechr/x/human.ParseDuration.

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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