MCPcopy Create free account
hub / github.com/bytebase/bytebase / timeToMsDosTime

Function timeToMsDosTime

backend/component/export/zip.go:50–54  ·  view source on GitHub ↗

timeToMsDosTime converts a time.Time to an MS-DOS date and time. This is a modified copy for github.com/alexmullins/zip/struct.go because the package has a bug, it will convert the time to UTC time and drop the timezone.

(t time.Time)

Source from the content-addressed store, hash-verified

48// This is a modified copy for github.com/alexmullins/zip/struct.go because the package has a bug,
49// it will convert the time to UTC time and drop the timezone.
50func timeToMsDosTime(t time.Time) (uint16, uint16) {
51 fDate := uint16(t.Day() + int(t.Month())<<5 + (t.Year()-1980)<<9)
52 fTime := uint16(t.Second()/2 + t.Minute()<<5 + t.Hour()<<11)
53 return fDate, fTime
54}

Callers 1

CreateZipFileHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected