timelib

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Now = time.Now

Functions

This section is empty.

Types

type Interface

type Interface interface {
	GetCurrentTime() time.Time
	SubstractTime(origin, deductor time.Time) time.Duration
	AddTime(origin time.Time, adder time.Duration) time.Time
	GetTimeInLocation(locationParam Location, timeParam time.Time) (time.Time, error)
	GetFirstDayOfTheMonth(year int, month time.Month) time.Time
	GetLastDayOfTheMonth(year int, month time.Month) time.Time
	ConvertFromString(timeFormat, timeString string) (time.Time, error)
	ConvertToString(timeFormat string, timeParam time.Time) string
}

func Init

func Init() Interface

type Location

type Location string
const (
	// Location
	AsiaJakarta   Location = "Asia/Jakarta"   // GMT+7
	AsiaSingapore Location = "Asia/Singapore" // GMT+8
	AsiaJayapura  Location = "Asia/Jayapura"  // GMT+9
)

Jump to

Keyboard shortcuts

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