Documentation ¶
Index ¶
- Constants
- Variables
- func AddWorkingDaysInLocation(t time.Time, days int, loc *time.Location) time.Time
- func CountDateDiff(startTime, endTime time.Time, loc *time.Location) int64
- func GetTodayFirstSecInLocation(t time.Time, loc *time.Location) time.Time
- func GetTodayLastSecInLocation(t time.Time, loc *time.Location) time.Time
- func Now() time.Time
- type MySQLDatetime
- func (dt MySQLDatetime) AddWorkingDaysCST(days int) MySQLDatetime
- func (dt MySQLDatetime) Format(layout string) string
- func (dt MySQLDatetime) GetTodayFirstSecCST() MySQLDatetime
- func (dt MySQLDatetime) GetTodayLastSecCST() MySQLDatetime
- func (dt MySQLDatetime) In(loc *time.Location) MySQLDatetime
- func (dt MySQLDatetime) IsZero() bool
- func (dt MySQLDatetime) MarshalText() ([]byte, error)
- func (dt *MySQLDatetime) Scan(value interface{}) error
- func (dt MySQLDatetime) String() string
- func (dt MySQLDatetime) Unix() int64
- func (dt *MySQLDatetime) UnmarshalText(data []byte) (err error)
- func (dt MySQLDatetime) Value() (driver.Value, error)
- type MySQLTimestamp
- func (dt MySQLTimestamp) AddWorkingDaysCST(days int) MySQLTimestamp
- func (dt MySQLTimestamp) Format(layout string) string
- func (dt MySQLTimestamp) GetTodayFirstSecCST() MySQLTimestamp
- func (dt MySQLTimestamp) GetTodayLastSecCST() MySQLTimestamp
- func (dt MySQLTimestamp) In(loc *time.Location) MySQLTimestamp
- func (dt MySQLTimestamp) IsZero() bool
- func (dt MySQLTimestamp) MarshalText() ([]byte, error)
- func (dt *MySQLTimestamp) Scan(value interface{}) error
- func (dt MySQLTimestamp) String() string
- func (dt MySQLTimestamp) Unix() int64
- func (dt *MySQLTimestamp) UnmarshalText(data []byte) (err error)
- func (dt MySQLTimestamp) Value() (driver.Value, error)
Constants ¶
View Source
const ( WORKING_DAYS = 5 WEEKEND_DAYS = 2 DAY_SECONDS = 86400 )
View Source
const (
CST_ZONE_OFFSET = 8 * 60 * 60
)
Variables ¶
View Source
var ( MySQLTimestampZero = MySQLTimestamp(time.Time{}) MySQLTimestampUnixZero = MySQLTimestamp(time.Unix(0, 0)) )
View Source
var ( UTC *time.Location CST *time.Location )
View Source
var (
MySQLDatetimeZero = MySQLDatetime(time.Time{})
)
Functions ¶
func AddWorkingDaysInLocation ¶
根据指定时区添加 N 个工作日
func CountDateDiff ¶
计算日期偏差
func GetTodayFirstSecInLocation ¶
根据指定时区获取当天第一秒
func GetTodayLastSecInLocation ¶
根据指定时区获取当天最后一秒
Types ¶
type MySQLDatetime ¶
swagger:strfmt date-time
func ParseMySQLDatetimeFromString ¶
func ParseMySQLDatetimeFromString(s string) (dt MySQLDatetime, err error)
func ParseMySQLDatetimeFromStringWithFormatterInCST ¶
func ParseMySQLDatetimeFromStringWithFormatterInCST(s, formatter string) (dt MySQLDatetime, err error)
func (MySQLDatetime) AddWorkingDaysCST ¶
func (dt MySQLDatetime) AddWorkingDaysCST(days int) MySQLDatetime
添加N个工作日(东8区)
func (MySQLDatetime) Format ¶
func (dt MySQLDatetime) Format(layout string) string
func (MySQLDatetime) GetTodayFirstSecCST ¶
func (dt MySQLDatetime) GetTodayFirstSecCST() MySQLDatetime
获取当天0点(东8区)
func (MySQLDatetime) GetTodayLastSecCST ¶
func (dt MySQLDatetime) GetTodayLastSecCST() MySQLDatetime
获取当天最后一秒(东8区)
func (MySQLDatetime) In ¶
func (dt MySQLDatetime) In(loc *time.Location) MySQLDatetime
func (MySQLDatetime) IsZero ¶
func (dt MySQLDatetime) IsZero() bool
func (MySQLDatetime) MarshalText ¶
func (dt MySQLDatetime) MarshalText() ([]byte, error)
func (*MySQLDatetime) Scan ¶
func (dt *MySQLDatetime) Scan(value interface{}) error
func (MySQLDatetime) String ¶
func (dt MySQLDatetime) String() string
func (MySQLDatetime) Unix ¶
func (dt MySQLDatetime) Unix() int64
func (*MySQLDatetime) UnmarshalText ¶
func (dt *MySQLDatetime) UnmarshalText(data []byte) (err error)
type MySQLTimestamp ¶
swagger:strfmt date-time
func ParseMySQLTimestampFromString ¶
func ParseMySQLTimestampFromString(s string) (dt MySQLTimestamp, err error)
func (MySQLTimestamp) AddWorkingDaysCST ¶
func (dt MySQLTimestamp) AddWorkingDaysCST(days int) MySQLTimestamp
添加 N 个工作日(东8区)
func (MySQLTimestamp) Format ¶
func (dt MySQLTimestamp) Format(layout string) string
func (MySQLTimestamp) GetTodayFirstSecCST ¶
func (dt MySQLTimestamp) GetTodayFirstSecCST() MySQLTimestamp
获取当天0点(东8区)
func (MySQLTimestamp) GetTodayLastSecCST ¶
func (dt MySQLTimestamp) GetTodayLastSecCST() MySQLTimestamp
获取当天最后一秒(东8区)
func (MySQLTimestamp) In ¶
func (dt MySQLTimestamp) In(loc *time.Location) MySQLTimestamp
func (MySQLTimestamp) IsZero ¶
func (dt MySQLTimestamp) IsZero() bool
func (MySQLTimestamp) MarshalText ¶
func (dt MySQLTimestamp) MarshalText() ([]byte, error)
func (*MySQLTimestamp) Scan ¶
func (dt *MySQLTimestamp) Scan(value interface{}) error
func (MySQLTimestamp) String ¶
func (dt MySQLTimestamp) String() string
func (MySQLTimestamp) Unix ¶
func (dt MySQLTimestamp) Unix() int64
func (*MySQLTimestamp) UnmarshalText ¶
func (dt *MySQLTimestamp) UnmarshalText(data []byte) (err error)
Click to show internal directories.
Click to hide internal directories.