int IComparable.CompareTo(object obj) { if (obj == null) { return(1); } if (!(obj is DateTimeOffset)) { throw new ArgumentException(); } var other = (DateTimeOffset)obj; return(UtcDateTime.CompareTo(other.UtcDateTime)); }
public int CompareTo(object obj) { if (obj is ZonedDateTime zonded) { return(CompareTo(zonded)); } if (obj is DateTimeOffset offset) { return(UtcDateTime.CompareTo(offset.UtcDateTime)); } if (!(obj is DateTime date)) { throw new NotSupportedException(); } if (date.Kind == DateTimeKind.Utc) { return(UtcDateTime.CompareTo(date)); } return(UtcDateTime.CompareTo(DateTimeZone.ConvertTime(date, DateTimeZone.Local, DateTimeZone.Utc))); }
public int CompareTo(DateTimeOffset other) { return(UtcDateTime.CompareTo(other.UtcDateTime)); }
public int CompareTo(ZonedDateTime other) { return(UtcDateTime.CompareTo(other.UtcDateTime)); }