Documentation
¶
Index ¶
- Constants
- Variables
- func Before(beforeSecond int64) string
- func End(day int) string
- func Format(t time.Time, format string) string
- func GetFormat(format string) string
- func GetRFC3339() string
- func Hms() string
- func Next(beforeSecond int64) string
- func Now() string
- func NowTime() time.Time
- func NowUnix() int64
- func ParseEnd(s, fromFormat string) (result string, err error)
- func ParseStart(s, fromFormat string) (result string, err error)
- func RFC3339To(s string) string
- func RfcToUnix(s string) int64
- func Start(day int) string
- func ToRFC3339(s string) string
- func ToUnix(s string) int64
- func Ymd() string
- type GoTime
- func (g *GoTime) Before(beforeSecond int64) string
- func (g *GoTime) End(day int) string
- func (g *GoTime) Format(t time.Time, format string) string
- func (g *GoTime) GetFormat(format string) string
- func (g *GoTime) GetRFC3339() string
- func (g *GoTime) Hms() string
- func (g *GoTime) Next(beforeSecond int64) string
- func (g *GoTime) Now() string
- func (g *GoTime) NowTime() time.Time
- func (g *GoTime) NowUnix() int64
- func (g *GoTime) ParseEnd(s, fromFormat string) (result string, err error)
- func (g *GoTime) ParseStart(s, fromFormat string) (result string, err error)
- func (g *GoTime) RFC3339To(s string) string
- func (g *GoTime) RfcToUnix(s string) int64
- func (g *GoTime) Start(day int) string
- func (g *GoTime) ToRFC3339(s string) string
- func (g *GoTime) ToUnix(s string) int64
- func (g *GoTime) Ymd() string
Constants ¶
View Source
const ( RFC3339 = "2006-01-02T15:04:05+08:00" TT = "2006-01-02 15:04:05" YMD = "2006-01-02" HMS = "15:04:05" )
常量
Variables ¶
View Source
var BeijingLocation = time.FixedZone("Asia/Shanghai", 8*60*60)
北京东八时区
Functions ¶
Types ¶
type GoTime ¶
func NewBeijing ¶
func NewBeijing() *GoTime
func (*GoTime) Format ¶
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 (*GoTime) ParseStart ¶
将格式化为一天的零点
Click to show internal directories.
Click to hide internal directories.