Documentation
¶
Index ¶
- Constants
- func CSTLayoutString() string
- func CSTLayoutStringToUnix(cstLayoutString string) (int64, error)
- func GMTLayoutString() string
- func ParseCSTInLocation(date string) (time.Time, error)
- func ParseGMTInLocation(date string) (time.Time, error)
- func RFC3339ToCSTLayout(value string) (string, error)
- func SubInLocation(ts time.Time) float64
- type Time
Constants ¶
View Source
const CSTLayout = "2006-01-02 15:04:05"
CSTLayout China Standard Time Layout
Variables ¶
This section is empty.
Functions ¶
func CSTLayoutString ¶
func CSTLayoutString() string
CSTLayoutString returns time string in "2006-01-02 15:04:05" format
func CSTLayoutStringToUnix ¶
CSTLayoutStringToUnix return unix timestamp 2020-01-24 21:11:11 => 1579871471
func GMTLayoutString ¶
func GMTLayoutString() string
GMTLayoutString returns time sting in "Mon, 02 Jan 2006 15:04:05 GMT" format
func ParseCSTInLocation ¶
ParseCSTInLocation formats time use China Standard Time Layout
func ParseGMTInLocation ¶
ParseGMTInLocation formats time use GMT layout
func RFC3339ToCSTLayout ¶
RFC3339ToCSTLayout convert rfc3339 value to China standard time layout 2020-11-08T08:18:46+08:00 => 2020-11-08 08:18:46
func SubInLocation ¶
SubInLocation calculates time difference
Types ¶
Click to show internal directories.
Click to hide internal directories.