Implement decoding High Sierra timestamp.

This commit is contained in:
2019-07-20 01:45:40 +01:00
parent 1d3a0eccbc
commit 824d02878d
3 changed files with 87 additions and 60 deletions

View File

@@ -21,5 +21,21 @@ namespace DiscImageChef.Filesystems.ISO9660
return null;
}
}
DateTime? DecodeHighSierraDateTime(HighSierraTimestamp timestamp)
{
try
{
DateTime date = new DateTime(timestamp.Years + 1900, timestamp.Month, timestamp.Day, timestamp.Hour,
timestamp.Minute, timestamp.Second, DateTimeKind.Unspecified);
return TimeZoneInfo.ConvertTimeToUtc(date, TimeZoneInfo.FindSystemTimeZoneById("GMT"));
}
catch(Exception e)
{
// ISO says timestamp can be unspecified, suppose same for High Sierra
return null;
}
}
}
}