You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IEnumerable<MyMessage>myMessages=GetSome();varinChronologicalOrder=myMessages.OrderBy(m =>m.MyTimestampField).ToArray();// At least one object must implement IComparable
I know that dealing with time in code is wrought with perilous traps and so I'm wondering if there's a reason that it is ill-advised to make this comparable. I couldn't think of one. If you convert a Timestamp to a DateTime, UTC is specified for you, and if you try to get a Timestamp from a DateTime structure that doesn't specify itself as UTC, it fails. So therefore we don't think Timestamp should be storing anything that is non-UTC. But if we think that Timestamp is UTC, then it should be safe to compare it to other Timestamps, right?
The text was updated successfully, but these errors were encountered:
This is a runtime exception:
I know that dealing with time in code is wrought with perilous traps and so I'm wondering if there's a reason that it is ill-advised to make this comparable. I couldn't think of one. If you convert a Timestamp to a DateTime, UTC is specified for you, and if you try to get a Timestamp from a DateTime structure that doesn't specify itself as UTC, it fails. So therefore we don't think Timestamp should be storing anything that is non-UTC. But if we think that Timestamp is UTC, then it should be safe to compare it to other Timestamps, right?
The text was updated successfully, but these errors were encountered: