Use UTC as starting point for ISO9660, leap seconds should only cause a problem when UTC time is assumed to be GMT and not reverse.

This commit is contained in:
2020-07-23 22:09:40 +01:00
parent b23d976f93
commit 430db71b37

View File

@@ -174,10 +174,9 @@ namespace Aaru.Helpers
sbyte difference = (sbyte)vdDateTime[16];
var decodedDt = new DateTime(year, month, day, hour, minute, second, hundredths * 10,
DateTimeKind.Unspecified);
DateTimeKind.Utc);
// Convert ISO9660 time from GMT to UTC and remove the difference from GMT. Doing the removal first could cause problems if that makes it cross over a leap day, or a leap second
return TimeZoneInfo.ConvertTimeBySystemTimeZoneId(decodedDt, "GMT", "UTC").AddMinutes(difference * -15);
return decodedDt.AddMinutes(difference * -15);
}
/// <summary>Converts a VMS timestamp to a .NET DateTime</summary>