import "github.com/jinzhu/now"
Package now is a time toolkit for golang.
More details README here: https://github.com/jinzhu/now
import "github.com/jinzhu/now" now.BeginningOfMinute() // 2013-11-18 17:51:00 Mon now.BeginningOfDay() // 2013-11-18 00:00:00 Mon now.EndOfDay() // 2013-11-18 23:59:59.999999999 Mon
Code:
time.Now() // 2013-11-18 17:51:49.123456789 Mon BeginningOfMinute() // 2013-11-18 17:51:00 Mon BeginningOfHour() // 2013-11-18 17:00:00 Mon BeginningOfDay() // 2013-11-18 00:00:00 Mon BeginningOfWeek() // 2013-11-17 00:00:00 Sun WeekStartDay = time.Monday // Set Monday as first day BeginningOfWeek() // 2013-11-18 00:00:00 Mon BeginningOfMonth() // 2013-11-01 00:00:00 Fri BeginningOfQuarter() // 2013-10-01 00:00:00 Tue BeginningOfYear() // 2013-01-01 00:00:00 Tue EndOfMinute() // 2013-11-18 17:51:59.999999999 Mon EndOfHour() // 2013-11-18 17:59:59.999999999 Mon EndOfDay() // 2013-11-18 23:59:59.999999999 Mon EndOfWeek() // 2013-11-23 23:59:59.999999999 Sat WeekStartDay = time.Monday // Set Monday as first day EndOfWeek() // 2013-11-24 23:59:59.999999999 Sun EndOfMonth() // 2013-11-30 23:59:59.999999999 Sat EndOfQuarter() // 2013-12-31 23:59:59.999999999 Tue EndOfYear() // 2013-12-31 23:59:59.999999999 Tue // Use another time t := time.Date(2013, 02, 18, 17, 51, 49, 123456789, time.UTC) New(t).EndOfMonth() // 2013-02-28 23:59:59.999999999 Thu Monday() // 2013-11-18 00:00:00 Mon Sunday() // 2013-11-24 00:00:00 Sun EndOfSunday() // 2013-11-24 23:59:59.999999999 Sun
var TimeFormats = []string{"1/2/2006", "1/2/2006 15:4:5", "2006", "2006-1", "2006-1-2", "2006-1-2 15", "2006-1-2 15:4", "2006-1-2 15:4:5", "1-2", "15:4:5", "15:4", "15", "15:4:5 Jan 2, 2006 MST", "2006-01-02 15:04:05.999999999 -0700 MST"}
TimeFormats default time formats will be parsed as
WeekStartDay set week start day, default is sunday
BeginningOfDay beginning of day
BeginningOfHour beginning of hour
BeginningOfMinute beginning of minute
BeginningOfMonth beginning of month
BeginningOfQuarter beginning of quarter
BeginningOfWeek beginning of week
BeginningOfYear beginning of year
Between check now between the begin, end time or not
EndOfDay end of day
EndOfHour end of hour
EndOfMinute end of minute
EndOfMonth end of month
EndOfQuarter end of quarter
EndOfSunday end of sunday
EndOfWeek end of week
EndOfYear end of year
Monday monday
MustParse must parse string to time or will panic
MustParseInLocation must parse string to time in location or will panic
Parse parse string to time
ParseInLocation parse string to time in location
Sunday sunday
Now now struct
New initialize Now with time
BeginningOfDay beginning of day
BeginningOfHour beginning of hour
BeginningOfMinute beginning of minute
BeginningOfMonth beginning of month
BeginningOfQuarter beginning of quarter
BeginningOfWeek beginning of week
BeginningOfYear BeginningOfYear beginning of year
Between check time between the begin, end time or not
EndOfDay end of day
EndOfHour end of hour
EndOfMinute end of minute
EndOfMonth end of month
EndOfQuarter end of quarter
EndOfSunday end of sunday
EndOfWeek end of week
EndOfYear end of year
Monday monday
MustParse must parse string to time or it will panic
Parse parse string to time
Sunday sunday
Package now imports 3 packages (graph) and is imported by 107 packages. Updated 2018-05-11. Refresh now. Tools for package owners.