Exemplo n.º 1
0
 //
 // Summary:
 //     Subtracts a DeltaSpace.DateTimeOffset value that represents a specific date and
 //     time from the current DeltaSpace.DateTimeOffset object.
 //
 // Parameters:
 //   value:
 //     An object that represents the value to subtract.
 //
 // Returns:
 //     An object that specifies the interval between the two DeltaSpace.DateTimeOffset
 //     objects.
 public TimeSpan Subtract(DateTimeOffset value)
 {
     return this.value.Subtract(value.value);
 }
Exemplo n.º 2
0
 //
 // Summary:
 //     Compares two DeltaSpace.DateTimeOffset objects and indicates whether the first
 //     is earlier than the second, equal to the second, or later than the second.
 //
 // Parameters:
 //   first:
 //     The first object to compare.
 //
 //   second:
 //     The second object to compare.
 //
 // Returns:
 //     A signed integer that indicates whether the value of the first parameter
 //     is earlier than, later than, or the same time as the value of the second
 //     parameter, as the following table shows.Return valueMeaningLess than zerofirst
 //     is earlier than second.Zerofirst is equal to second.Greater than zerofirst
 //     is later than second.
 public static int Compare(
                                         DateTimeOffset          first,
                                         SystemDateTimeOffset    second
                                     )
 {
     return SystemDateTimeOffset.Compare(first.value, second);
 }
Exemplo n.º 3
0
 //
 // Summary:
 //     Determines whether the current DeltaSpace.DateTimeOffset object represents the
 //     same time and has the same offset as a specified DeltaSpace.DateTimeOffset object.
 //
 // Parameters:
 //   other:
 //     The object to compare to the current DeltaSpace.DateTimeOffset object.
 //
 // Returns:
 //     true if the current DeltaSpace.DateTimeOffset object and other have the same
 //     date and time value and the same DeltaSpace.DateTimeOffset.Offset value; otherwise,
 //     false.
 public bool EqualsExact(DateTimeOffset other)
 {
     return this.value.EqualsExact(other.value);
 }
Exemplo n.º 4
0
 //
 // Summary:
 //     Compares the current DeltaSpace.DateTimeOffset object to a specified DeltaSpace.DateTimeOffset
 //     object and indicates whether the current object is earlier than, the same
 //     as, or later than the second DeltaSpace.DateTimeOffset object.
 //
 // Parameters:
 //   other:
 //     An object to compare with the current DeltaSpace.DateTimeOffset object.
 //
 // Returns:
 //     A signed integer that indicates the relationship between the current DeltaSpace.DateTimeOffset
 //     object and other, as the following table shows.Return ValueDescriptionLess
 //     than zeroThe current DeltaSpace.DateTimeOffset object is earlier than other.ZeroThe
 //     current DeltaSpace.DateTimeOffset object is the same as other.Greater than zero.The
 //     current DeltaSpace.DateTimeOffset object is later than other.
 public int CompareTo(DateTimeOffset other)
 {
     return this.value.CompareTo(other.value);
 }
Exemplo n.º 5
0
 //
 // Summary:
 //     Converts the specified string representation of a date and time to its DeltaSpace.DateTimeOffset
 //     equivalent using the specified array of formats, culture-specific format
 //     information, and style. The format of the string representation must match
 //     one of the specified formats exactly.
 //
 // Parameters:
 //   input:
 //     A string that contains a date and time to convert.
 //
 //   formats:
 //     An array that defines the expected formats of input.
 //
 //   formatProvider:
 //     An object that supplies culture-specific formatting information about input.
 //
 //   styles:
 //     A bitwise combination of enumeration values that indicates the permitted
 //     format of input. A typical value to specify is None.
 //
 //   result:
 //     When the method returns, contains the DeltaSpace.DateTimeOffset equivalent to
 //     the date and time of input, if the conversion succeeded, or DeltaSpace.DateTimeOffset.MinValue,
 //     if the conversion failed. The conversion fails if the input does not contain
 //     a valid string representation of a date and time, or does not contain the
 //     date and time in the expected format defined by format, or if formats is
 //     null. This parameter is passed uninitialized.
 //
 // Returns:
 //     true if the input parameter is successfully converted; otherwise, false.
 //
 // Exceptions:
 //   System.ArgumentException:
 //     styles includes an undefined System.Globalization.DateTimeStyles value.-or-System.Globalization.DateTimeStyles.NoCurrentDateDefault
 //     is not supported.-or-styles includes mutually exclusive System.Globalization.DateTimeStyles
 //     values.
 public static bool TryParseExact(
                                         string          input, 
                                         string[]        formats, 
                                         IFormatProvider formatProvider, 
                                         DateTimeStyles  styles, 
                                     out DateTimeOffset  result
                                     )
 {
     SystemDateTimeOffset    systemResult;
     bool                    success         = SystemDateTimeOffset.TryParseExact(input, formats, formatProvider, styles, out systemResult);
     result  = new DateTimeOffset(systemResult);
     return success;
 }
Exemplo n.º 6
0
 public static bool TryParse(
                                         string          input, 
                                     out DateTimeOffset  result
                                     )
 {
     SystemDateTimeOffset    systemResult;
     bool                    success         = SystemDateTimeOffset.TryParse(input, out systemResult);
     result  = new DateTimeOffset(systemResult);
     return success;
 }
Exemplo n.º 7
0
 //
 // Summary:
 //     Determines whether two specified DeltaSpace.DateTimeOffset objects represent
 //     the same point in time.
 //
 // Parameters:
 //   first:
 //     The first object to compare.
 //
 //   second:
 //     The second object to compare.
 //
 // Returns:
 //     true if the two DeltaSpace.DateTimeOffset objects have the same DeltaSpace.DateTimeOffset.UtcDateTime
 //     value; otherwise, false.
 public static bool Equals(
                                         DateTimeOffset          first,
                                         SystemDateTimeOffset    second
                                     )
 {
     return SystemDateTimeOffset.Equals(first.value, second);
 }