dates

package
v0.0.165 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 2 Imported by: 12

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 GetLast24HoursRange added in v0.0.159

func GetLast24HoursRange(now time.Time) (time.Time, time.Time)

func GetLast3dRange added in v0.0.161

func GetLast3dRange(now time.Time) (time.Time, time.Time)

func GetLastMonthRange added in v0.0.160

func GetLastMonthRange(now time.Time) (time.Time, time.Time)

func GetLastPeriodRange added in v0.0.163

func GetLastPeriodRange(now time.Time, period time.Duration) (time.Time, time.Time)

func GetLastWeekRange added in v0.0.158

func GetLastWeekRange(now time.Time) (time.Time, time.Time)

func GetMonthRange added in v0.0.157

func GetMonthRange(year int, month time.Month) (time.Time, time.Time)

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

Directories

Path Synopsis
i18n
ru