SqlFunctions.DateAdd Method
Returns a new datetime value based on adding an interval to the specified date.
Assembly: EntityFramework.SqlServer (in EntityFramework.SqlServer.dll)
Name | Description | |
---|---|---|
![]() ![]() | DateAdd(String, Nullable<Double>, Nullable<DateTime>) | Returns a new datetime value based on adding an interval to the specified date. |
![]() ![]() | 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<TimeSpan>) | Returns a new time span value based on adding an interval to the specified time span. |
![]() ![]() | DateAdd(String, Nullable<Double>, String) | Returns a new datetime value based on adding an interval to the specified date. |
SqlFunctions.DateAdd Method (String, Nullable<Double>, Nullable<DateTime>)
Returns a new datetime value based on adding an interval to the specified date.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [DbFunctionAttribute("SqlServer", "DATEADD")] public static Nullable<DateTime> DateAdd( string datePartArg, Nullable<double> number, Nullable<DateTime> date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to increment.
- number
-
Type:
System.Nullable<Double>
The value used to increment a date by a specified amount.
- date
-
Type:
System.Nullable<DateTime>
The date to increment.
SqlFunctions.DateAdd Method (String, Nullable<Double>, Nullable<DateTimeOffset>)
Returns a new date value based on adding an interval to the specified date.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "dateTimeOffsetArg")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [DbFunctionAttribute("SqlServer", "DATEADD")] public static Nullable<DateTimeOffset> DateAdd( string datePartArg, Nullable<double> number, Nullable<DateTimeOffset> dateTimeOffsetArg )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to increment.
- number
-
Type:
System.Nullable<Double>
The value used to increment a date by a specified amount.
- dateTimeOffsetArg
-
Type:
System.Nullable<DateTimeOffset>
The date to increment.
Return Value
Type: System.Nullable<DateTimeOffset>The new point in time, expressed as a date and time of day, relative to Coordinated Universal Time (UTC).
SqlFunctions.DateAdd Method (String, Nullable<Double>, Nullable<TimeSpan>)
Returns a new time span value based on adding an interval to the specified time span.
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "time")] [DbFunctionAttribute("SqlServer", "DATEADD")] public static Nullable<TimeSpan> DateAdd( string datePartArg, Nullable<double> number, Nullable<TimeSpan> time )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to increment.
- number
-
Type:
System.Nullable<Double>
The value used to increment a date by a specified amount.
- time
-
Type:
System.Nullable<TimeSpan>
The time span to increment.
SqlFunctions.DateAdd Method (String, Nullable<Double>, String)
Returns a new datetime value based on adding an interval to the specified date.
[DbFunctionAttribute("SqlServer", "DATEADD")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "datePartArg")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "date")] [SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")] public static Nullable<DateTime> DateAdd( string datePartArg, Nullable<double> number, string date )
Parameters
- datePartArg
-
Type:
System.String
The part of the date to increment.
- number
-
Type:
System.Nullable<Double>
The value used to increment a date by a specified amount.
- date
-
Type:
System.String
The date to increment.