README

reltime

Package reltime implements a "time ago" algorithm.

import (
	"code.soquee.net/reltime"
)

License

The package may be used under the terms of the BSD 2-Clause License a copy of which may be found in the LICENSE file.

Unless you explicitly state otherwise, any contribution submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.

Documentation

Overview

Package reltime implements a "time ago" algorithm.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ago

func Ago(d time.Duration) string

Ago transforms durations into human readable strings.

Example
Output:

about a day ago

func TimeAgo

func TimeAgo(t time.Time) string

TimeAgo transforms the difference between a time and the current time into a human readable string.

It is a convenience wrapper for Ago(time.Until(t)). For more information see the example on Ago.

Types

This section is empty.

Source Files