date_util

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: BSD-3-Clause Imports: 1 Imported by: 24

Documentation

Overview

Package date_util contains utility methods for Time instances.

Index

Constants

View Source
const (
	// Format as yyyyMMdd
	YMDFormat = "20060102"
)

Variables

This section is empty.

Functions

func TimeToDate

func TimeToDate(t time.Time) time.Time

TimeToDate returns t with the time of day zeroed out and the time zone GMT.

func YMD

func YMD(year int, month int, day int) time.Time

YMD creates a new time.Time object in UTC time zone from year, month, day.

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock is the interface that wraps the Now method.

type SystemClock

type SystemClock struct {
}

SystemClock provides the current time.

func (SystemClock) Now

func (s SystemClock) Now() time.Time

Jump to

Keyboard shortcuts

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