Edit

Share via


EntityFunctions.AddMonths Method

Definition

Invokes the canonical AddMonths function. For information about the canonical AddMonths function, see Date and Time Canonical Functions.

Overloads

AddMonths(Nullable<DateTime>, Nullable<Int32>)

Invokes the canonical AddMonths function. For information about the canonical AddMonths function, see Date and Time Canonical Functions.

AddMonths(Nullable<DateTimeOffset>, Nullable<Int32>)

Invokes the canonical AddMonths function. For information about the canonical AddMonths function, see Date and Time Canonical Functions.

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database.

AddMonths(Nullable<DateTime>, Nullable<Int32>)

Invokes the canonical AddMonths function. For information about the canonical AddMonths function, see Date and Time Canonical Functions.

[System.Data.Objects.DataClasses.EdmFunction("Edm", "AddMonths")]
public static DateTime? AddMonths(DateTime? dateValue, int? addValue);

Parameters

dateValue
Nullable<DateTime>

A valid date.

addValue
Nullable<Int32>

The number of months to add to dateValue.

Returns

The dateValue incremented by addValue.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

AddMonths(Nullable<DateTimeOffset>, Nullable<Int32>)

Invokes the canonical AddMonths function. For information about the canonical AddMonths function, see Date and Time Canonical Functions.

[System.Data.Objects.DataClasses.EdmFunction("Edm", "AddMonths")]
public static DateTimeOffset? AddMonths(DateTimeOffset? dateValue, int? addValue);

Parameters

dateValue
Nullable<DateTimeOffset>

A valid date time offset.

addValue
Nullable<Int32>

The number of months to add to dateValue.

Returns

The dateValue incremented by addValue.

Attributes

Remarks

You cannot call this function directly. This function can only appear within a LINQ to Entities query.

This function is translated to a corresponding function in the database.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1