ToDateTime() private method

Creates a DateTime instance from the current time.
private ToDateTime ( ) : DateTime
return DateTime
Beispiel #1
0
 /// <summary>
 /// Returns the result of comparing this instance to another <b>Time</b>
 /// instance.
 /// </summary>
 /// <param name="other">The other <b>Time</b> instance to compare with.</param>
 /// <returns>An integer value indicating the relative ordering.</returns>
 public int CompareTo(Time other)
 {
     if ((timeZone == null) && (other.timeZone == null))
     {
         return(timeValue.CompareTo(other.timeValue));
     }
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone))
     {
         return(timeValue.CompareTo(other.timeValue));
     }
     else
     {
         return(ToDateTime().CompareTo(other.ToDateTime()));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Determines if the <b>Time</b> instance and another hold the same value.
 /// </summary>
 /// <param name="other">The <see cref="Time"/> to compare with.</param>
 /// <returns><b>true</b> if both instances are times and represent the
 ///	same value, <b>false</b> otherwise.</returns>
 public bool Equals(Time other)
 {
     if ((timeZone == null) && (other.timeZone == null))
     {
         return(timeValue.Equals(other.timeValue));
     }
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone))
     {
         return(timeValue.Equals(other.timeValue));
     }
     else
     {
         return(ToDateTime().Equals(other.ToDateTime()));
     }
 }
Beispiel #3
0
 /// <summary>
 /// Determines if the <b>Time</b> instance and another hold the same value.
 /// </summary>
 /// <param name="other">The <see cref="Time"/> to compare with.</param>
 /// <returns><b>true</b> if both instances are times and represent the
 ///	same value, <b>false</b> otherwise.</returns>
 public bool Equals(Time other)
 {
     if ((timeZone == null) && (other.timeZone == null))
         return (timeValue.Equals (other.timeValue));
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone))
         return (timeValue.Equals (other.timeValue));
     else
         return (ToDateTime ().Equals (other.ToDateTime ()));
 }
Beispiel #4
0
 /// <summary>
 /// Returns the result of comparing this instance to another <b>Time</b>
 /// instance.
 /// </summary>
 /// <param name="other">The other <b>Time</b> instance to compare with.</param>
 /// <returns>An integer value indicating the relative ordering.</returns>
 public int CompareTo(Time other)
 {
     if ((timeZone == null) && (other.timeZone == null))
         return (timeValue.CompareTo (other.timeValue));
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone))
         return (timeValue.CompareTo (other.timeValue));
     else
         return (ToDateTime ().CompareTo (other.ToDateTime ()));
 }