timestamp

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package timestamp is a package for making it easier to send timestamps in Discord messages

Index

Constants

View Source
const (
	// FormatTypeShortTime will look like the following: 16:20
	FormatTypeShortTime = "t"
	// FormatTypeLongTime will look like the following: 16:20:30
	FormatTypeLongTime = "T"
	// FormatTypeShortDate will look like the following: 20/04/2021
	FormatTypeShortDate = "d"
	// FormatTypeLongDate will look like the following: 20 April 2021
	FormatTypeLongDate = "D"
	// FormatTypeShortDateTime will look like the following: 20 April 2021 16:20 (Default)
	FormatTypeShortDateTime = "f"
	// FormatTypeLongDateTime will look like the following: Tuesday, 20 April 2021 16:20
	FormatTypeLongDateTime = "F"
	// FormatTypeRelative will look like the following: 2 months ago
	FormatTypeRelative = "R"
)

Variables

This section is empty.

Functions

func FormatTime

func FormatTime(time time.Time, format FormatType) string

FormatTime returns the time with the given format

Types

type FormatType

type FormatType string

FormatType represents the format type of how it will look like in Discord

Jump to

Keyboard shortcuts

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