Documentation ¶
Index ¶
- Constants
- func ByteToFloat32_BigEndian(bytes []byte) float32
- func ByteToFloat32_LittleEndian(bytes []byte) float32
- func ByteToFloat64_BigEndian(bytes []byte) float64
- func ByteToFloat64_LittleEndian(bytes []byte) float64
- func BytesToInt32_BigEndian(b []byte) int
- func BytesToInt32_LittleEndian(b []byte) int
- func BytesToInt64_BigEndian(buf []byte) int64
- func BytesToInt64_LittleEndian(buf []byte) int64
- func Float32ToByte_BigEndian(float float32) []byte
- func Float32ToByte_LittleEndian(float float32) []byte
- func Float64ToByte_BigEndian(float float64) []byte
- func Float64ToByte_LittleEndian(float float64) []byte
- func FormatFloat(value float64, decNum uint8) (result float64)
- func Int32ToBytes_BigEndian(n int) []byte
- func Int32ToBytes_LittleEndian(n int) []byte
- func Int64ToBytes_BigEndian(i int64) []byte
- func Int64ToBytes_LittleEndian(i int64) []byte
- func Int64ToStr(value int64) (result string)
- func IntToStr(value int) (result string)
- func MustParse(datestr string) time.Time
- func ParseAny(datestr string) (time.Time, error)
- func ParseIn(datestr string, loc *time.Location) (time.Time, error)
- func ParseLocal(datestr string) (time.Time, error)
- func SliceByteToString(b []byte) string
- func StrToDateTime(str string, fmt string) time.Time
- func StrToFloat(value string) (result float64)
- func StrToFloatDef(value string, defvalue float64) (result float64)
- func StrToInt(value string) (result int)
- func StrToIntdef(value string, defvalue int) (result int)
- func StringToSliceByte(s string) []byte
- func UnixTimeToDateTime(value int64) time.Time
Constants ¶
const (
Day = time.Hour * 24
)
Variables ¶
This section is empty.
Functions ¶
func ByteToFloat32_BigEndian ¶
func ByteToFloat64_BigEndian ¶
func BytesToInt32_BigEndian ¶
func BytesToInt64_BigEndian ¶
func Float32ToByte_BigEndian ¶
func Float64ToByte_BigEndian ¶
func Int64ToBytes_BigEndian ¶
func Int64ToStr ¶
func MustParse ¶
MustParse parse a date, and panic if it can't be parsed. Used for testing. Not recommended for most use-cases.
func ParseAny ¶
ParseAny parse an unknown date format, detect the layout, parse. Normal parse. Equivalent Timezone rules as time.Parse()
func ParseIn ¶
ParseIn with Location, equivalent to time.ParseInLocation() timezone/offset rules. Using location arg, if timezone/offset info exists in the datestring, it uses the given location rules for any zone interpretation. That is, MST means one thing when using America/Denver and something else in other locations.
func ParseLocal ¶
ParseLocal Given an unknown date format, detect the layout, using time.Local, parse.
Set Location to time.Local. Same as ParseIn Location but lazily uses the global time.Local variable for Location argument.
denverLoc, _ := time.LoadLocation("America/Denver") time.Local = denverLoc t, err := dateparse.ParseLocal("3/1/2014")
Equivalent to:
t, err := dateparse.ParseIn("3/1/2014", denverLoc)
func SliceByteToString ¶
func StrToFloatDef ¶
func StrToIntdef ¶
func StringToSliceByte ¶
func UnixTimeToDateTime ¶
Types ¶
This section is empty.