/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer hash code.</returns> public override int GetHashCode() { unchecked { return((EpochSeconds.GetHashCode() * 397) ^ NanosOfSecond); } }
public override string ToString() { if (!string.IsNullOrWhiteSpace(Identifier)) { return(EpochSeconds + "." + Identifier); } return(EpochSeconds.ToString()); }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer hash code.</returns> public override int GetHashCode() { unchecked { var hashCode = EpochSeconds.GetHashCode(); hashCode = (hashCode * 397) ^ NanosOfSecond; hashCode = (hashCode * 397) ^ (ZoneId != null ? ZoneId.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns>A 32-bit signed integer hash code.</returns> public override int GetHashCode() { unchecked { var hashCode = EpochSeconds.GetHashCode(); hashCode = (hashCode * 397) ^ NanosOfSecond; hashCode = (hashCode * 397) ^ OffsetSeconds; return(hashCode); } }
public int CompareTo(Timestamp other) { if (ReferenceEquals(this, other)) { return(0); } if (other is null) { return(1); } var epochSecondsComparison = EpochSeconds.CompareTo(other.EpochSeconds); if (epochSecondsComparison != 0) { return(epochSecondsComparison); } return(string.Compare(Identifier, other.Identifier, StringComparison.Ordinal)); }