MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / FormatBinaryDate

Function FormatBinaryDate

IceFireDB-SQLite/pkg/mysql/mysql/util.go:264–276  ·  view source on GitHub ↗
(n int, data []byte)

Source from the content-addressed store, hash-verified

262}
263
264func FormatBinaryDate(n int, data []byte) ([]byte, error) {
265 switch n {
266 case 0:
267 return []byte("0000-00-00"), nil
268 case 4:
269 return fmt.Appendf(nil, "%04d-%02d-%02d",
270 binary.LittleEndian.Uint16(data[:2]),
271 data[2],
272 data[3]), nil
273 default:
274 return nil, errors.Errorf("invalid date packet length %d", n)
275 }
276}
277
278func FormatBinaryDateTime(n int, data []byte) ([]byte, error) {
279 switch n {

Callers 1

ParseBinaryMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected