strftime

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package strftime provides an strftime() implementation for Time formating.

Index

Constants

This section is empty.

Variables

View Source
var Pgettext = newTranslatable

Pgettext is an alias for newTranslatable so it can be picked up by a locales extractor.

Functions

func Strftime

func Strftime(format string, t time.Time) string

Strftime returns a formatted string in English.

Types

type Formatter

type Formatter struct {
	// contains filtered or unexported fields
}

Formatter is the time formatter.

func New

func New(tr Translator) *Formatter

New returns a new Formatter with a given translator.

func (*Formatter) Strftime

func (f *Formatter) Strftime(format string, t time.Time) string

Strftime returns a formatted time string.

type Translator

type Translator interface {
	Pgettext(string, string, ...interface{}) string
}

Translator describes a type that implements a translation method.

Jump to

Keyboard shortcuts

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