bc-csharp icon indicating copy to clipboard operation
bc-csharp copied to clipboard

Fix for issue #410: Update Asn1GeneralizedTime.cs with more precision

Open RobLinux opened this issue 2 years ago • 5 comments

added 3 more rounds of precision in FromString

RobLinux avatar Dec 27 '22 14:12 RobLinux

I think it is not so simple. The current class relies on not losing precision in the conversion to DateTime, where a tick is 100ns. So if the value has higher precision, probably ToDateTime() shouldn't be available (maybe there could be other methods that are clear about giving a "nearest" value of some kind, or methods to compare to a DateTime) , and also ToStringCanonical would have to operate on the high-precision string directly and not rely on conversion from DateTime.

peterdettman avatar Jan 03 '23 04:01 peterdettman

The thing is the current solution is not working with Apple ASN objects. So indeed some precisions would be lost, but at least the objects would be parsed correctly without exception.

What would you recommend in this case?

RobLinux avatar Jan 10 '23 11:01 RobLinux

Any update on this ? what can we do ? it's actually a problem in my organization

RobLinux avatar Apr 04 '24 01:04 RobLinux

Because the problem is that currently I can't deserialie a datetime with a higher precision, which is a problem.

RobLinux avatar Apr 04 '24 01:04 RobLinux

https://chat.openai.com/share/6471db26-d1aa-4e76-bd69-73206ba70ad4 what about this ?

RobLinux avatar Apr 04 '24 02:04 RobLinux