timeutil

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package timeutil contains the functions to parse and format time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatAge

func FormatAge(t time.Time) string

FormatAge converts a timestamp into a human-readable duration string Examples: "37s", "3m12s", "14h", "2d4h"

func FormatDeleteAfter

func FormatDeleteAfter(t time.Time) string

func ParseDeleteAfter

func ParseDeleteAfter(dateStr string) time.Time

ParseDeleteAfter parses a date string in the format "2006-01-02-15-04" Returns zero time if parsing fails

func TtlToDuration added in v0.1.2

func TtlToDuration(ttl string) (time.Duration, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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