Documentation ¶
Index ¶
- Constants
- func AddDate(t time.Time, years int, months int) time.Time
- func GetBjTimeLoc() *time.Location
- type LocalDate
- func (t LocalDate) Format(fmt string) string
- func (t *LocalDate) IsAfter(t2 *LocalDate) bool
- func (t *LocalDate) IsBefore(t2 *LocalDate) bool
- func (t *LocalDate) IsEqual(t2 *LocalDate) bool
- func (t LocalDate) MarshalJSON() ([]byte, error)
- func (t *LocalDate) MinusDays(d int) (t2 *LocalDate)
- func (t *LocalDate) MinusMonths(m int) (t2 *LocalDate)
- func (t *LocalDate) PlusDays(d int) (t2 *LocalDate)
- func (t *LocalDate) Scan(v interface{}) error
- func (t LocalDate) String() string
- func (t *LocalDate) ToEpochDay() (days int)
- func (t *LocalDate) UnmarshalJSON(data []byte) (err error)
- func (t LocalDate) Value() (driver.Value, error)
Constants ¶
View Source
const ( DTF_YMD = "2006-01-02" DTF_YM = "2006_01" BeiJinAreaTime = "Asia/Shanghai" )
Variables ¶
This section is empty.
Functions ¶
func AddDate ¶
AddDate 时间增减 类似于ruby中的时间增减,和 time.AddDate 不同 如: loc, _ := time.LoadLocation("Asia/Shanghai") t := time.Date(2010, 3, 31, 12, 0, 0, 0, loc) utils.AddDate(t, 0, 1) => 2010-04-30 12:00:00 +0800 CST 不会因为4月没有31号,而变成5月1号
func GetBjTimeLoc ¶
Types ¶
type LocalDate ¶
func (LocalDate) MarshalJSON ¶
func (*LocalDate) MinusMonths ¶
func (*LocalDate) ToEpochDay ¶
func (*LocalDate) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.