|
@@ -62,6 +62,20 @@ func StrToDate(s string) (t time.Time, err error) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// StrToLocationTime 字符串转时间
|
|
|
|
|
+func StrToLocationTime(s string) (t time.Time, err error) {
|
|
|
|
|
+ t, err = time.ParseInLocation(TimeFmtLong, s, time.Local)
|
|
|
|
|
+
|
|
|
|
|
+ return
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// StrFmtLocationTime 字符串转时间
|
|
|
|
|
+func StrFmtLocationTime(s, fmt string) (t time.Time, err error) {
|
|
|
|
|
+ t, err = time.ParseInLocation(fmt, s, time.Local)
|
|
|
|
|
+
|
|
|
|
|
+ return
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// IsWeekEnd 日期是否周末
|
|
// IsWeekEnd 日期是否周末
|
|
|
func IsWeekEnd(d time.Weekday) bool {
|
|
func IsWeekEnd(d time.Weekday) bool {
|
|
|
day := int(d)
|
|
day := int(d)
|