dates

package
v0.0.131 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 1 Imported by: 6

Documentation

Index

Constants

View Source
const (
	DateFormatDashYYYYMMDD           = "2006-01-02"
	DateFormatPointDDMMYYYY          = "02.01.2006"
	DateFormatPointDDMMYY            = "02.01.06"
	DateFormatDashDDMMYYYY           = "02-01-2006"
	DateFormatDashDDMMYY             = "02-01-06"
	DateTimeFormatDashYYYYMMDDHHmmss = "2006-01-02 15:04:05"
	DateTimeFormat1C                 = "2006-01-02T15:04:05"
	DateTimeFormatQiwi               = "02012006 15:04:05"
	DateFormatYYYYMMDD               = "20060102"
	DateTimeFormatYYYYMMDDHHmmss     = "20060102150405"
)
View Source
const (
	WeekDays  = 7
	MonthDays = 31
	YearDays  = 365
)
View Source
const (
	SecondsInMinute = 60
	SecondsInHour   = 3600
	SecondsInDay    = 86400
	MinutesInHour   = 60
	MinutesInDay    = 1440
	HourInDay       = 24

	MonthInYear = 12
)

Variables

This section is empty.

Functions

func AfterPeriod

func AfterPeriod(t time.Time, period int64, measure time.Duration) time.Time

func BeforePeriod

func BeforePeriod(t time.Time, period int64, measure time.Duration) time.Time

func BeginOfDay

func BeginOfDay(t time.Time) time.Time

func BeginOfNextDay

func BeginOfNextDay(t time.Time) time.Time

func BeginOfNextWeek

func BeginOfNextWeek(t time.Time) time.Time

func BeginOfPrevDay

func BeginOfPrevDay(t time.Time) time.Time

func BeginOfPrevWeek

func BeginOfPrevWeek(t time.Time) time.Time

func GetBerlinLocation added in v0.0.126

func GetBerlinLocation() *time.Location

func GetMoscowLocation added in v0.0.87

func GetMoscowLocation() *time.Location

func GetSamaraLocation added in v0.0.87

func GetSamaraLocation() *time.Location

Types

type DateTimeDiff

type DateTimeDiff struct {
	Year  int
	Month int
	Day   int
	Hour  int
	Min   int
	Sec   int
}

func Diff

func Diff(a, b time.Time) *DateTimeDiff

Jump to

Keyboard shortcuts

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