Open 270676504 opened 6 months ago
public NSDate(ReadOnlySpan<byte> bytes)
{
//dates are 8 byte big-endian double, seconds since the epoch
try
{
Date = EPOCH.AddSeconds(BinaryPropertyListParser.ParseDouble(bytes));
}
catch
{
Date = EPOCH;
}
}
The Exception is:"The added or subtracted value results in an un-representable DateTime. Arg_ParamName_Name" Simply adding try-catch can fix this problem. public NSDate(ReadOnlySpan bytes)
{
try
{
Date = EPOCH.AddSeconds(BinaryPropertyListParser.ParseDouble(bytes));
}
catch (Exception)
{
Date = EPOCH;
}
}