ToDateTime() public method

Creates a DateTime instance representing midnight on the morning of the current date.
public ToDateTime ( ) : DateTime
return DateTime
Ejemplo n.º 1
0
 /// <summary>
 /// Returns the result of comparing this instance to another <b>Date</b>.
 /// </summary>
 /// <param name="other">The <b>Date</b> instance to compare with.</param>
 /// <returns>An integer value indicating the relative ordering.</returns>
 public int CompareTo(Date other)
 {
     if ((timeZone == null) && (other.timeZone == null))
     {
         return(dateValue.CompareTo(other.dateValue));
     }
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone))
     {
         return(dateValue.CompareTo(other.dateValue));
     }
     else
     {
         return(ToDateTime().CompareTo(other.ToDateTime()));
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Determines if this <b>Date</b> instance and another hold the same
 /// date.
 /// </summary>
 /// <param name="other">The <b>Date</b> instance to compare with.</param>
 /// <returns><c>true</c> if both instance represent the same date,
 /// <c>false</c> otherwise.</returns>
 public bool Equals(Date other)
 {
     if ((timeZone == null) && (other.timeZone == null))
     {
         return(dateValue.Equals(other.dateValue));
     }
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals(other.timeZone))
     {
         return(dateValue.Equals(other.dateValue));
     }
     else
     {
         return(ToDateTime().Equals(other.ToDateTime()));
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Determines if this <b>Date</b> instance and another hold the same
 /// date.
 /// </summary>
 /// <param name="other">The <b>Date</b> instance to compare with.</param>
 /// <returns><c>true</c> if both instance represent the same date,
 /// <c>false</c> otherwise.</returns>
 public bool Equals(Date other)
 {
     if ((timeZone == null) && (other.timeZone == null))
         return (dateValue.Equals (other.dateValue));
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone))
         return (dateValue.Equals (other.dateValue));
     else
         return (ToDateTime ().Equals (other.ToDateTime ()));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Returns the result of comparing this instance to another <b>Date</b>.
 /// </summary>
 /// <param name="other">The <b>Date</b> instance to compare with.</param>
 /// <returns>An integer value indicating the relative ordering.</returns>
 public int CompareTo(Date other)
 {
     if ((timeZone == null) && (other.timeZone == null))
         return (dateValue.CompareTo (other.dateValue));
     else if ((timeZone != null) && (other.timeZone != null) && timeZone.Equals (other.timeZone))
         return (dateValue.CompareTo (other.dateValue));
     else
         return (ToDateTime ().CompareTo (other.ToDateTime ()));
 }