Example #1
0
 // timeToMsDosTime converts a time.Time to an MS-DOS date and time.
 // The resolution is 2s.
 // See: http://msdn.microsoft.com/en-us/library/ms724274(v=VS.85).aspx
 private static (ushort, ushort) timeToMsDosTime(time.Time t)
 {
     fDate = uint16(t.Day() + int(t.Month()) << (int)(5L) + (t.Year() - 1980L) << (int)(9L));
     fTime = uint16(t.Second() / 2L + t.Minute() << (int)(5L) + t.Hour() << (int)(11L));
     return;
 }