Documentation ¶
Index ¶
- Variables
- func Date(ti int64, format string) string
- func DateParse(dateString, format string) (time.Time, error)
- func DateS(ts string, format string) string
- func DateT(t time.Time, format string) string
- func GetBetweenDates(date_start, date_end time.Time) (d []time.Time)
- func GetFirstDateOfMonth(d time.Time) time.Time
- func GetFirstDateOfWeek(d time.Time, start_sunday bool) time.Time
- func GetFirstDateOfYear(d time.Time) time.Time
- func GetLastDateOfMonth(d time.Time) time.Time
- func GetZeroTimeOfDay(d time.Time) time.Time
- func LunarToSolar(date string, leapMonthFlag bool) (d string, err error)
- func SolarToChineseLuanr(date string) string
- func SolarToLuanr(date string) (string, bool)
- func SolarToSimpleLuanr(date string) string
- func TimeNtpCompare(date string) (err error)
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var CHINESENUMBER = []string{"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"}
View Source
var CHINESENUMBERSPECIAL = []string{"正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "腊"}
View Source
var DATELAYOUT = "2006-01-02"
View Source
var LUNAR_INFO = []int{}/* 150 elements not displayed */
View Source
var ListNtps = []string{
"cn.pool.ntp.org",
"cn.ntp.org.cn",
"edu.ntp.org.cn",
"ntp.aliyun.com",
"ntp1.aliyun.com",
"ntp2.aliyun.com",
"ntp3.aliyun.com",
"ntp4.aliyun.com",
"ntp5.aliyun.com",
"ntp6.aliyun.com",
"ntp7.aliyun.com",
"hk.ntp.org.cn",
"sgp.ntp.org.cn",
"us.ntp.org.cn",
"time.sunqida.cn",
}
View Source
var MAX_YEAR = 2049
View Source
var MIN_YEAR = 1900
View Source
var MONTHNUMBER = map[string]int{"January": 1, "February": 2, "March": 3, "April": 4, "May": 5, "June": 6, "July": 7, "August": 8, "September": 9, "October": 10, "November": 11, "December": 12}
View Source
var STARTDATESTR = "1900-01-30"
View Source
var ShangHaiZone, _ = time.LoadLocation("Asia/Shanghai")
Functions ¶
func DateT ¶
Format time.Time struct to string MM - month - 01 M - month - 1, single bit DD - day - 02 D - day 2 YYYY - year - 2006 YY - year - 06 HH - 24 hours - 03 H - 24 hours - 3 hh - 12 hours - 03 h - 12 hours - 3 mm - minute - 04 m - minute - 4 ss - second - 05 s - second = 5
func GetFirstDateOfMonth ¶
获取传入的时间所在月份的第一天,即某月第一天的0点。如传入time.Now(), 返回当前月份的第一天0点时间。
func GetLastDateOfMonth ¶
获取传入的时间所在月份的最后一天,即某月最后一天的0点。如传入time.Now(), 返回当前月份的最后一天0点时间。
func SolarToChineseLuanr ¶
func SolarToLuanr ¶
func SolarToSimpleLuanr ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.