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)
| 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. |
| 50 | func 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 | } |
no outgoing calls
no test coverage detected