* README.md:

* DiscImageChef.DiscImages/CopyQM.cs:
	* DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj:
	  Added support for Sydex CopyQM disk image format.

	* DiscImageChef.CommonTypes/MediaType.cs:
	  Corrected typo.

	* DiscImageChef.DiscImages/DiskCopy42.cs:
	  Misplacement of XML media type setting.

	* DiscImageChef.Helpers/DateHandlers.cs:
	  Added DOS to C# date converter.
This commit is contained in:
2016-08-07 04:35:32 +01:00
parent 53477406f0
commit a063ac04dc
2 changed files with 18 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
2016-08-07 Natalia Portillo <claunia@claunia.com>
* DateHandlers.cs: Added DOS to C# date converter.
2016-08-01 Natalia Portillo <claunia@claunia.com>
* AssemblyInfo.cs:

View File

@@ -150,6 +150,20 @@ namespace DiscImageChef
DicConsole.DebugWriteLine("UCSDPascalToDateTime handler", "dateRecord = 0x{0:X4}, year = {1}, month = {2}, day = {3}", dateRecord, year, month, day);
return new DateTime(year, month, day);
}
public static DateTime DOSToDateTime(ushort date, ushort time)
{
int year = ((date & 0xFE00) >> 9) + 1980;
int month = (date & 0x1E0) >> 5;
int day = date & 0x1F;
int hour = (time & 0xF800) >> 11;
int minute = (time & 0x7E0) >> 5;
int second = (time & 0x1F) * 2;
DicConsole.DebugWriteLine("DOSToDateTime handler", "date = 0x{0:X4}, year = {1}, month = {2}, day = {3}", date, year, month, day);
DicConsole.DebugWriteLine("DOSToDateTime handler", "time = 0x{0:X4}, hour = {1}, minute = {2}, second = {3}", time, hour, minute, second);
return new DateTime(year, month, day, hour, minute, second);
}
}
}