Documentation ¶
Index ¶
- Constants
- Variables
- func BytesInSlice(a []byte, list [][]byte) bool
- func BytesToUint16(b []byte) uint16
- func BytesToUint32(b []byte) uint32
- func BytesToUint64(b []byte) uint64
- func BytesToUints16(b []byte) (res []uint16)
- func Format(format string, date time.Time) string
- func FormatDate(date time.Time) string
- func FormatDateTime(date time.Time) string
- func FormatTime(date time.Time) string
- func Parse(format string, value string) (time.Time, error)
- func ParseDate(value string) (time.Time, error)
- func ParseDateTime(value string) (time.Time, error)
- func ParseTime(value string) (time.Time, error)
- func TimeFromExcelTime(excelTime float64, date1904 bool) time.Time
- func TimeToExcelTime(t time.Time, date1904 bool) float64
- func TimeToUTCTime(t time.Time) time.Time
Constants ¶
const ( MJD_0 float64 = 2400000.5 MJD_JD2000 float64 = 51544.5 )
Variables ¶
var ( DefaultTimeFormat = "hh:mm:ss" DefaultDateFormat = "YYYY-MM-DD" DefaultDateTimeFormat = "YYYY-MM-DD hh:mm:ss" )
var Placeholder = []p{
{"hh", "15"},
{"h", "03"},
{"mm", "04"},
{"ss", "05"},
{"MMMM", "January"},
{"MMM", "Jan"},
{"MM", "01"},
{"M", "1"},
{"pm", "PM"},
{"ZZZZ", "-0700"},
{"ZZZ", "MST"},
{"ZZ", "Z07:00"},
{"YYYY", "2006"},
{"YY", "06"},
{"DDDD", "Monday"},
{"DDD", "Mon"},
{"DD", "02"},
{"D", "2"},
}
Functions ¶
func BytesInSlice ¶
func BytesToUint16 ¶
func BytesToUint32 ¶
func BytesToUint64 ¶
func BytesToUints16 ¶
func Format ¶
Format formats a date based on Microsoft Excel (TM) conventions Format("DD.MM.YYYY", time.Now())
func FormatDate ¶
FormatDate formats the given date to the DefaultDateFormat
func FormatDateTime ¶
FormatDateTime formats the given date to the DefaultDateTimeFormat
func FormatTime ¶
FormatTime formats the given date to the DefaultTimeFormat
func Parse ¶
Parse parses a value to a date based on Microsoft Excel (TM) formats Parse("M/D/YY", "2/3/07")
func ParseDateTime ¶
ParseDateTime Parse parses a date in DefaultDateTimeFormat to a date
func TimeFromExcelTime ¶
Convert an excelTime representation (stored as a floating point number) to a time.Time.
func TimeToExcelTime ¶
TimeToExcelTime will convert a time.Time into Excel's float representation, in either 1900 or 1904 mode. If you don't know which to use, set date1904 to false. TODO should this should handle Julian dates?
Types ¶
This section is empty.