mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Implement ISO9660 file record timestamp decoding.
This commit is contained in:
@@ -4,6 +4,22 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
{
|
||||
public partial class ISO9660
|
||||
{
|
||||
DateTime DecodeIsoDateTime(byte[] date) => throw new NotImplementedException();
|
||||
DateTime? DecodeIsoDateTime(IsoTimestamp timestamp)
|
||||
{
|
||||
try
|
||||
{
|
||||
DateTime date = new DateTime(timestamp.Years + 1900, timestamp.Month, timestamp.Day, timestamp.Hour,
|
||||
timestamp.Minute, timestamp.Second, DateTimeKind.Unspecified);
|
||||
|
||||
date = date.AddMinutes(timestamp.GmtOffset * 15);
|
||||
|
||||
return TimeZoneInfo.ConvertTimeToUtc(date, TimeZoneInfo.FindSystemTimeZoneById("GMT"));
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
// ISO says timestamp can be unspecified
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user