datetime

package
v0.0.0-...-da6f084 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefalutFormat  = "2006-01-02 15:04:05"
	CompressFormat = "20060102150405"
)

Variables

View Source
var (
	/** 设置每周的起始时间 */
	WeekStartDay = time.Sunday

	/** 指定日期和时间的默认转换格式 */
	DateTimeFormats = []string{"1/2/2006", "1/2/2006 15:4:5", "2006", "2006-1-2", "2006-01-02 15:04:05", "20060102150405", "15:4:5 Jan 2, 2006 MST"}
)

Functions

func BeginThisMonth

func BeginThisMonth() time.Time

返回本月的第一刻

func BeginThisWeek

func BeginThisWeek() time.Time

返回本周的第一刻

func BeginThisYear

func BeginThisYear() time.Time

返回本年的第一刻

func CurrentCompress

func CurrentCompress() string

获取当前时间字符串 - yyyyMMddHHmmss

func CurrentDeflult

func CurrentDeflult() string

获取当前时间字符串 - yyyy-MM-dd HH:mm:ss

func CurrentHour

func CurrentHour() time.Time

当前小时

func CurrentMinute

func CurrentMinute() time.Time

当前分钟

func CurrentSecond

func CurrentSecond() time.Time

当前秒

func EndThisMonth

func EndThisMonth() time.Time

返回本月最后一刻

func EndThisWeek

func EndThisWeek() time.Time

返回本周最后一刻

func EndThisYear

func EndThisYear() time.Time

返回本年的最后一刻

func Parse

func Parse(str string) (t time.Time, err error)

字符串转时间

func Today

func Today() time.Time

返回今天的日期

func TodayEndMoment

func TodayEndMoment() time.Time

返回今天的最后一刻

Types

type DateTime

type DateTime struct {
	time.Time
}

DateTime 结构体

Jump to

Keyboard shortcuts

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