Show / Hide Table of Contents

    Struct DateSpan

    Represents a System.DateTime interval between two System.DateTime values.

    Implements
    System.IEquatable<DateSpan>
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public struct DateSpan : IEquatable<DateSpan>

    Constructors

    | Improve this Doc

    DateSpan(DateTime)

    Initializes a new instance of the DateSpan structure with a default System.DateTime value set to System.DateTime.Today.

    Declaration
    public DateSpan(DateTime start)
    Parameters
    Type Name Description
    System.DateTime start

    A System.DateTime value for the DateSpan calculation.

    | Improve this Doc

    DateSpan(DateTime, DateTime)

    Initializes a new instance of the DateSpan structure with a default Cuemon.DateSpan.Calendar value from the System.Globalization.CultureInfo.InvariantCulture class.

    Declaration
    public DateSpan(DateTime start, DateTime end)
    Parameters
    Type Name Description
    System.DateTime start

    A System.DateTime value for the DateSpan calculation.

    System.DateTime end

    A System.DateTime value for the DateSpan calculation.

    | Improve this Doc

    DateSpan(DateTime, DateTime, Calendar)

    Initializes a new instance of the DateSpan structure.

    Declaration
    public DateSpan(DateTime start, DateTime end, Calendar calendar)
    Parameters
    Type Name Description
    System.DateTime start

    A System.DateTime value for the DateSpan calculation.

    System.DateTime end

    A System.DateTime value for the DateSpan calculation.

    System.Globalization.Calendar calendar

    The Cuemon.DateSpan.Calendar that applies to this DateSpan.

    Properties

    | Improve this Doc

    Days

    Gets the number of days represented by the current DateSpan structure.

    Declaration
    public int Days { get; }
    Property Value
    Type Description
    System.Int32

    The number of days represented by the current DateSpan structure.

    | Improve this Doc

    Hours

    Gets the number of hours represented by the current DateSpan structure.

    Declaration
    public int Hours { get; }
    Property Value
    Type Description
    System.Int32

    The number of hours represented by the current DateSpan structure.

    | Improve this Doc

    Milliseconds

    Gets the number of milliseconds represented by the current DateSpan structure.

    Declaration
    public int Milliseconds { get; }
    Property Value
    Type Description
    System.Int32

    The number of milliseconds represented by the current DateSpan structure.

    | Improve this Doc

    Minutes

    Gets the number of minutes represented by the current DateSpan structure.

    Declaration
    public int Minutes { get; }
    Property Value
    Type Description
    System.Int32

    The number of minutes represented by the current DateSpan structure.

    | Improve this Doc

    Months

    Gets the number of months represented by the current DateSpan structure.

    Declaration
    public int Months { get; }
    Property Value
    Type Description
    System.Int32

    The number of months represented by the current DateSpan structure.

    | Improve this Doc

    Seconds

    Gets the number of seconds represented by the current DateSpan structure.

    Declaration
    public int Seconds { get; }
    Property Value
    Type Description
    System.Int32

    The number of seconds represented by the current DateSpan structure.

    | Improve this Doc

    Ticks

    Gets the number of ticks represented by the current DateSpan structure.

    Declaration
    public long Ticks { get; }
    Property Value
    Type Description
    System.Int64

    The number of ticks represented by the current DateSpan structure.

    | Improve this Doc

    TotalDays

    Gets the total number of days represented by the current DateSpan structure.

    Declaration
    public int TotalDays { get; }
    Property Value
    Type Description
    System.Int32

    The total number of days represented by the current DateSpan structure.

    | Improve this Doc

    TotalHours

    Gets the total number of hours represented by the current DateSpan structure.

    Declaration
    public long TotalHours { get; }
    Property Value
    Type Description
    System.Int64

    The total number of hours represented by the current DateSpan structure.

    | Improve this Doc

    TotalMilliseconds

    Gets the total number of milliseconds represented by the current DateSpan structure.

    Declaration
    public long TotalMilliseconds { get; }
    Property Value
    Type Description
    System.Int64

    The total number of milliseconds represented by the current DateSpan structure.

    | Improve this Doc

    TotalMinutes

    Gets the total number of minutes represented by the current DateSpan structure.

    Declaration
    public long TotalMinutes { get; }
    Property Value
    Type Description
    System.Int64

    The total number of minutes represented by the current DateSpan structure.

    | Improve this Doc

    TotalMonths

    Gets the total number of months represented by the current DateSpan structure.

    Declaration
    public int TotalMonths { get; }
    Property Value
    Type Description
    System.Int32

    The total number of months represented by the current DateSpan structure.

    | Improve this Doc

    TotalSeconds

    Gets the total number of seconds represented by the current DateSpan structure.

    Declaration
    public long TotalSeconds { get; }
    Property Value
    Type Description
    System.Int64

    The total number of seconds represented by the current DateSpan structure.

    | Improve this Doc

    Years

    Gets the number of years represented by the current DateSpan structure.

    Declaration
    public int Years { get; }
    Property Value
    Type Description
    System.Int32

    The number of years represented by the current DateSpan structure.

    Methods

    | Improve this Doc

    Equals(DateSpan)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(DateSpan other)
    Parameters
    Type Name Description
    DateSpan other

    An object to compare with this object.

    Returns
    Type Description
    System.Boolean

    true if the current object is equal to the other parameter; otherwise, false.

    | Improve this Doc

    Equals(Object)

    Determines whether the specified System.Object is equal to this instance.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The System.Object to compare with this instance.

    Returns
    Type Description
    System.Boolean

    true if the specified System.Object is equal to this instance; otherwise, false.

    Overrides
    System.ValueType.Equals(System.Object)
    | Improve this Doc

    GetHashCode()

    Returns a hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

    Overrides
    System.ValueType.GetHashCode()
    | Improve this Doc

    GetWeeks()

    Calculates the number of weeks represented by the current DateSpan structure.

    Declaration
    public int GetWeeks()
    Returns
    Type Description
    System.Int32

    Calculates the number of weeks represented by the current DateSpan structure.

    | Improve this Doc

    Parse(String)

    Constructs a new DateSpan object from a date and time interval specified in a string.

    Declaration
    public static DateSpan Parse(string start)
    Parameters
    Type Name Description
    System.String start

    A string that specifies the starting date and time value for the DateSpan interval.

    Returns
    Type Description
    DateSpan

    A DateSpan that corresponds to start and System.DateTime.Today for the last part of the interval.

    | Improve this Doc

    Parse(String, String)

    Constructs a new DateSpan object from a date and time interval specified in a string.

    Declaration
    public static DateSpan Parse(string start, string end)
    Parameters
    Type Name Description
    System.String start

    A string that specifies the starting date and time value for the DateSpan interval.

    System.String end

    A string that specifies the ending date and time value for the DateSpan interval.

    Returns
    Type Description
    DateSpan

    A DateSpan that corresponds to start and end of the interval.

    | Improve this Doc

    Parse(String, String, CultureInfo)

    Constructs a new DateSpan object from a date and time interval specified in a string.

    Declaration
    public static DateSpan Parse(string start, string end, CultureInfo culture)
    Parameters
    Type Name Description
    System.String start

    A string that specifies the starting date and time value for the DateSpan interval.

    System.String end

    A string that specifies the ending date and time value for the DateSpan interval.

    System.Globalization.CultureInfo culture

    A System.Globalization.CultureInfo to resolve a Cuemon.DateSpan.Calendar object from.

    Returns
    Type Description
    DateSpan

    A DateSpan that corresponds to start and end of the interval.

    | Improve this Doc

    ToString()

    Converts the value of the current DateSpan object to its equivalent string representation.

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    The System.String representation of the current DateSpan value.

    Overrides
    System.ValueType.ToString()
    Remarks

    The returned string has the following format: y*:MM:dd:hh:mm:ss.f*, where y* is the actual calculated years and f* is the actual calculated milliseconds.

    Operators

    | Improve this Doc

    Equality(DateSpan, DateSpan)

    Indicates whether two DateSpan instances are equal.

    Declaration
    public static bool operator ==(DateSpan dateSpan1, DateSpan dateSpan2)
    Parameters
    Type Name Description
    DateSpan dateSpan1

    The first date interval to compare.

    DateSpan dateSpan2

    The second date interval to compare.

    Returns
    Type Description
    System.Boolean

    true if the values of dateSpan1 and dateSpan2 are equal; otherwise, false.

    | Improve this Doc

    Inequality(DateSpan, DateSpan)

    Indicates whether two DateSpan instances are not equal.

    Declaration
    public static bool operator !=(DateSpan dateSpan1, DateSpan dateSpan2)
    Parameters
    Type Name Description
    DateSpan dateSpan1

    The first date interval to compare.

    DateSpan dateSpan2

    The second date interval to compare.

    Returns
    Type Description
    System.Boolean

    true if the values of dateSpan1 and dateSpan2 are not equal; otherwise, false.

    Implements

    System.IEquatable<T>

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX