Documentation ¶
Index ¶
- Variables
- func BeijingTimeLocation() *time.Location
- func ConvertAmPmHourTo24HourFormat(timeStr string, layout24Hour string) (string, error)
- func ConvertToGMTTime(gmtTime string) (time.Time, error)
- func CurrentHourStartAndEnd() (int, int64, int64)
- func Date2Ts(date string) int64
- func Date2TsLocal(date string, location *time.Location) int64
- func DateTime(format string) string
- func DateTime2Ts(dateTime string) int64
- func DateTime2TsLocal(dateTime string, location *time.Location) int64
- func DateTime2TsLocalFormat(dateTime string, location *time.Location, format string) int64
- func DateTimeLocal(format string, timeOffsetSec int) string
- func DatesForRangeTs(startTimestamp int64, endTimestamp int64, format string) []string
- func GetChinaTomorrowAMSeconds(isBeijing bool) int64
- func GetDateInterval(t1, t2 time.Time) int
- func GetLocalTomorrowAMSeconds() int64
- func GetNowDateForLocation(isBeijing bool) string
- func GetTimeNow() time.Time
- func GetTodayZero() time.Time
- func GetZero(targetTime time.Time) time.Time
- func IsSameDay(t1, t2 time.Time) bool
- func IsValidDate(str string) bool
- func IsValidDateTime(str string) bool
- func LastHourStartAndEnd(isBeijing bool) (int, int64, int64)
- func NextDate(d int) string
- func NextDateLocal(d int, timeOffsetSec int) string
- func Now() string
- func NowLocal(timeOffsetSec int) string
- func ParseTime(timeStr string) (datetime time.Time)
- func ParseTimeString(timeStr string) (datetime time.Time)
- func SinceDays(dateString string) (int64, error)
- func TimeRangeDates(startDate string, endDate string) []string
- func TimeRangeDay(stTime int64, endTIme int64) int
- func ToDate(ts int64, isBeijing bool) string
- func ToDateTime(ts int64, isBeijing bool) string
- func Today() string
- func TodayLocal(timeOffsetSec int) string
- func Ts2Date(ts int64) string
- func Ts2DateLocal(ts int64, timeOffsetSec int) string
- func Ts2DateTime(ts int64) string
- func Ts2DateTimeLocal(ts int64, timeOffsetSec int) string
- func Ts2DateTimeLocalFormat(ts int64, timeOffsetSec int, format string) string
- func Ts2Time(t int64) time.Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TimeLayout string = "2006-01-02 15:04:05" DateLayout = "20060102" TimeFormat = map[string]string{ "Y-m-d H:i:s": "2006-01-02 15:04:05", "Y-m-d": "2006-01-02", "Ymd": "20060102", "H:i:s": "15:04:05", "Y": "2006", "m": "01", "d": "02", } )
Functions ¶
func BeijingTimeLocation ¶
func ConvertAmPmHourTo24HourFormat ¶
convertTo24HourFormat 将时间字符串转换为 0-23 小时制 timeStr: 时间字符串,例如 "3:04 PM" 3:04 PM-->15:04 ,必须是这两个格式之一
func ConvertToGMTTime ¶
格式为: 2021-08-06T07:00:00+0000 To time.Time
func CurrentHourStartAndEnd ¶
func DateTime2Ts ¶
func DateTime2TsLocalFormat ¶
func DatesForRangeTs ¶
func GetDateInterval ¶
func GetLocalTomorrowAMSeconds ¶
func GetLocalTomorrowAMSeconds() int64
func GetNowDateForLocation ¶
func GetTodayZero ¶
func IsValidDate ¶
func LastHourStartAndEnd ¶
LastHourStartAndEnd 上一个小时的开始和结束时间戳
func ParseTimeString ¶
func TimeRangeDates ¶
func ToDateTime ¶
func Ts2DateTime ¶
func Ts2DateTimeLocal ¶
本地化日期时间 给定时间戳(以秒为单位)
func Ts2DateTimeLocalFormat ¶
将时间对象转换为特定时区的时间
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.