Search Results for

    Show / Hide Table of Contents

    Struct NpgsqlDate

    Implements
    IEquatable<NpgsqlDate>
    IComparable<NpgsqlDate>
    IComparable
    IComparer<NpgsqlDate>
    IComparer
    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.ReferenceEquals(Object, Object)
    Namespace: NpgsqlTypes
    Assembly: Npgsql.dll
    Syntax
    [Obsolete("For values outside the range of DateTime/DateOnly, consider using NodaTime (range -9998 to 9999), or read the value as an 'int'. See https://www.npgsql.org/doc/types/datetime.html for more information.")]
    [Serializable]
    public readonly struct NpgsqlDate : IEquatable<NpgsqlDate>, IComparable<NpgsqlDate>, IComparable, IComparer<NpgsqlDate>, IComparer

    Constructors

    NpgsqlDate(NpgsqlDate)

    Declaration
    public NpgsqlDate(NpgsqlDate copyFrom)
    Parameters
    Type Name Description
    NpgsqlDate copyFrom

    NpgsqlDate(DateTime)

    Declaration
    public NpgsqlDate(DateTime dateTime)
    Parameters
    Type Name Description
    DateTime dateTime

    NpgsqlDate(Int32, Int32, Int32)

    Declaration
    public NpgsqlDate(int year, int month, int day)
    Parameters
    Type Name Description
    Int32 year
    Int32 month
    Int32 day

    Fields

    Epoch

    Represents the date 1970-01-01

    Declaration
    public static readonly NpgsqlDate Epoch
    Field Value
    Type Description
    NpgsqlDate

    Era

    Represents the date 0001-01-01

    Declaration
    public static readonly NpgsqlDate Era
    Field Value
    Type Description
    NpgsqlDate

    Infinity

    Declaration
    public static readonly NpgsqlDate Infinity
    Field Value
    Type Description
    NpgsqlDate

    MaxCalculableValue

    Declaration
    public static readonly NpgsqlDate MaxCalculableValue
    Field Value
    Type Description
    NpgsqlDate

    MaxYear

    Declaration
    public const int MaxYear = 5874897
    Field Value
    Type Description
    Int32

    MinCalculableValue

    Declaration
    public static readonly NpgsqlDate MinCalculableValue
    Field Value
    Type Description
    NpgsqlDate

    MinYear

    Declaration
    public const int MinYear = -4714
    Field Value
    Type Description
    Int32

    NegativeInfinity

    Declaration
    public static readonly NpgsqlDate NegativeInfinity
    Field Value
    Type Description
    NpgsqlDate

    Properties

    Day

    Declaration
    public readonly int Day { get; }
    Property Value
    Type Description
    Int32

    DayOfWeek

    Declaration
    public readonly DayOfWeek DayOfWeek { get; }
    Property Value
    Type Description
    DayOfWeek

    DayOfYear

    Declaration
    public readonly int DayOfYear { get; }
    Property Value
    Type Description
    Int32

    IsFinite

    Declaration
    public readonly bool IsFinite { get; }
    Property Value
    Type Description
    Boolean

    IsInfinity

    Declaration
    public readonly bool IsInfinity { get; }
    Property Value
    Type Description
    Boolean

    IsLeapYear

    Declaration
    public readonly bool IsLeapYear { get; }
    Property Value
    Type Description
    Boolean

    IsNegativeInfinity

    Declaration
    public readonly bool IsNegativeInfinity { get; }
    Property Value
    Type Description
    Boolean

    Month

    Declaration
    public readonly int Month { get; }
    Property Value
    Type Description
    Int32

    Now

    Declaration
    public static readonly NpgsqlDate Now { get; }
    Property Value
    Type Description
    NpgsqlDate

    Today

    Declaration
    public static readonly NpgsqlDate Today { get; }
    Property Value
    Type Description
    NpgsqlDate

    Tomorrow

    Declaration
    public static readonly NpgsqlDate Tomorrow { get; }
    Property Value
    Type Description
    NpgsqlDate

    Year

    Declaration
    public readonly int Year { get; }
    Property Value
    Type Description
    Int32

    Yesterday

    Declaration
    public static readonly NpgsqlDate Yesterday { get; }
    Property Value
    Type Description
    NpgsqlDate

    Methods

    Add(in NpgsqlTimeSpan)

    Declaration
    public readonly NpgsqlDate Add(in NpgsqlTimeSpan interval)
    Parameters
    Type Name Description
    NpgsqlTimeSpan interval
    Returns
    Type Description
    NpgsqlDate

    AddDays(Int32)

    Declaration
    public readonly NpgsqlDate AddDays(int days)
    Parameters
    Type Name Description
    Int32 days
    Returns
    Type Description
    NpgsqlDate

    AddMonths(Int32)

    Declaration
    public readonly NpgsqlDate AddMonths(int months)
    Parameters
    Type Name Description
    Int32 months
    Returns
    Type Description
    NpgsqlDate

    AddYears(Int32)

    Declaration
    public readonly NpgsqlDate AddYears(int years)
    Parameters
    Type Name Description
    Int32 years
    Returns
    Type Description
    NpgsqlDate

    Compare(NpgsqlDate, NpgsqlDate)

    Declaration
    public readonly int Compare(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Int32

    Compare(Object, Object)

    Declaration
    public readonly int Compare(object x, object y)
    Parameters
    Type Name Description
    Object x
    Object y
    Returns
    Type Description
    Int32

    CompareTo(NpgsqlDate)

    Declaration
    public readonly int CompareTo(NpgsqlDate other)
    Parameters
    Type Name Description
    NpgsqlDate other
    Returns
    Type Description
    Int32

    CompareTo(Object)

    Declaration
    public readonly int CompareTo(object o)
    Parameters
    Type Name Description
    Object o
    Returns
    Type Description
    Int32

    Equals(NpgsqlDate)

    Declaration
    public readonly bool Equals(NpgsqlDate other)
    Parameters
    Type Name Description
    NpgsqlDate other
    Returns
    Type Description
    Boolean

    Equals(Object)

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    Parse(String)

    Declaration
    public static NpgsqlDate Parse(string str)
    Parameters
    Type Name Description
    String str
    Returns
    Type Description
    NpgsqlDate

    Subtract(in NpgsqlTimeSpan)

    Declaration
    public readonly NpgsqlDate Subtract(in NpgsqlTimeSpan interval)
    Parameters
    Type Name Description
    NpgsqlTimeSpan interval
    Returns
    Type Description
    NpgsqlDate

    ToDateTime(NpgsqlDate)

    Declaration
    public static DateTime ToDateTime(NpgsqlDate date)
    Parameters
    Type Name Description
    NpgsqlDate date
    Returns
    Type Description
    DateTime

    ToNpgsqlDate(DateTime)

    Declaration
    public static NpgsqlDate ToNpgsqlDate(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    NpgsqlDate

    ToString()

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    TryParse(String, out NpgsqlDate)

    Declaration
    public static bool TryParse(string str, out NpgsqlDate date)
    Parameters
    Type Name Description
    String str
    NpgsqlDate date
    Returns
    Type Description
    Boolean

    Operators

    Addition(NpgsqlDate, NpgsqlTimeSpan)

    Declaration
    public static NpgsqlDate operator +(NpgsqlDate date, NpgsqlTimeSpan interval)
    Parameters
    Type Name Description
    NpgsqlDate date
    NpgsqlTimeSpan interval
    Returns
    Type Description
    NpgsqlDate

    Addition(NpgsqlTimeSpan, NpgsqlDate)

    Declaration
    public static NpgsqlDate operator +(NpgsqlTimeSpan interval, NpgsqlDate date)
    Parameters
    Type Name Description
    NpgsqlTimeSpan interval
    NpgsqlDate date
    Returns
    Type Description
    NpgsqlDate

    Equality(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator ==(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    Explicit(NpgsqlDate to DateTime)

    Declaration
    public static explicit operator DateTime(NpgsqlDate date)
    Parameters
    Type Name Description
    NpgsqlDate date
    Returns
    Type Description
    DateTime

    Explicit(DateTime to NpgsqlDate)

    Declaration
    public static explicit operator NpgsqlDate(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    NpgsqlDate

    GreaterThan(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator>(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    GreaterThanOrEqual(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator >=(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    Inequality(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator !=(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    LessThan(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator <(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    LessThanOrEqual(NpgsqlDate, NpgsqlDate)

    Declaration
    public static bool operator <=(NpgsqlDate x, NpgsqlDate y)
    Parameters
    Type Name Description
    NpgsqlDate x
    NpgsqlDate y
    Returns
    Type Description
    Boolean

    Subtraction(NpgsqlDate, NpgsqlDate)

    Declaration
    public static NpgsqlTimeSpan operator -(NpgsqlDate dateX, NpgsqlDate dateY)
    Parameters
    Type Name Description
    NpgsqlDate dateX
    NpgsqlDate dateY
    Returns
    Type Description
    NpgsqlTimeSpan

    Subtraction(NpgsqlDate, NpgsqlTimeSpan)

    Declaration
    public static NpgsqlDate operator -(NpgsqlDate date, NpgsqlTimeSpan interval)
    Parameters
    Type Name Description
    NpgsqlDate date
    NpgsqlTimeSpan interval
    Returns
    Type Description
    NpgsqlDate

    Implements

    System.IEquatable<T>
    System.IComparable<T>
    System.IComparable
    System.Collections.Generic.IComparer<T>
    System.Collections.IComparer
    In This Article
    Back to top © Copyright 2022 The Npgsql Development Team