SqlFunctions.DateAdd Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
DateAdd(String, Nullable<Double>, String) |
Returns a new datetime value based on adding an interval to the specified date. |
DateAdd(String, Nullable<Double>, Nullable<TimeSpan>) |
Returns a new time span value based on adding an interval to the specified time span. |
DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>) |
Returns a new date value based on adding an interval to the specified date. |
DateAdd(String, Nullable<Double>, Nullable<DateTime>) |
Returns a new datetime value based on adding an interval to the specified date. |
DateAdd(String, Nullable<Double>, String)
Returns a new datetime value based on adding an interval to the specified date.
[System.Data.Entity.DbFunction("SqlServer", "DATEADD")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="date")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="number")]
public static Nullable<DateTime> DateAdd (string datePartArg, Nullable<double> number, string date);
static member DateAdd : string * Nullable<double> * string -> Nullable<DateTime>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), date As String) As Nullable(Of DateTime)
Parameters
- datePartArg
- String
The part of the date to increment.
- date
- String
The date to increment.
Returns
A Nullable<T> of DateTime value that is the new date.
- Attributes
Applies to
DateAdd(String, Nullable<Double>, Nullable<TimeSpan>)
Returns a new time span value based on adding an interval to the specified time span.
[System.Data.Entity.DbFunction("SqlServer", "DATEADD")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="number")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="time")]
public static Nullable<TimeSpan> DateAdd (string datePartArg, Nullable<double> number, Nullable<TimeSpan> time);
static member DateAdd : string * Nullable<double> * Nullable<TimeSpan> -> Nullable<TimeSpan>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), time As Nullable(Of TimeSpan)) As Nullable(Of TimeSpan)
Parameters
- datePartArg
- String
The part of the date to increment.
Returns
The new time span.
- Attributes
Applies to
DateAdd(String, Nullable<Double>, Nullable<DateTimeOffset>)
Returns a new date value based on adding an interval to the specified date.
[System.Data.Entity.DbFunction("SqlServer", "DATEADD")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="number")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="dateTimeOffsetArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
public static Nullable<DateTimeOffset> DateAdd (string datePartArg, Nullable<double> number, Nullable<DateTimeOffset> dateTimeOffsetArg);
static member DateAdd : string * Nullable<double> * Nullable<DateTimeOffset> -> Nullable<DateTimeOffset>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), dateTimeOffsetArg As Nullable(Of DateTimeOffset)) As Nullable(Of DateTimeOffset)
Parameters
- datePartArg
- String
The part of the date to increment.
- dateTimeOffsetArg
- Nullable<DateTimeOffset>
The date to increment.
Returns
The new point in time, expressed as a date and time of day, relative to Coordinated Universal Time (UTC).
- Attributes
Applies to
DateAdd(String, Nullable<Double>, Nullable<DateTime>)
Returns a new datetime value based on adding an interval to the specified date.
[System.Data.Entity.DbFunction("SqlServer", "DATEADD")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="datePartArg")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="number")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="date")]
public static Nullable<DateTime> DateAdd (string datePartArg, Nullable<double> number, Nullable<DateTime> date);
static member DateAdd : string * Nullable<double> * Nullable<DateTime> -> Nullable<DateTime>
Public Shared Function DateAdd (datePartArg As String, number As Nullable(Of Double), date As Nullable(Of DateTime)) As Nullable(Of DateTime)
Parameters
- datePartArg
- String
The part of the date to increment.
Returns
The new date.
- Attributes
Applies to
Entity Framework