DbFunctions.DiffSeconds Method

Definition

Overloads

DiffSeconds(Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.

DiffSeconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.

DiffSeconds(Nullable<TimeSpan>, Nullable<TimeSpan>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two time spans.

DiffSeconds(Nullable<DateTime>, Nullable<DateTime>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.

[System.Data.Entity.DbFunction("Edm", "DiffSeconds")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
public static Nullable<int> DiffSeconds(Nullable<DateTime> timeValue1, Nullable<DateTime> timeValue2);

Parameters

timeValue1
Nullable<DateTime>

The first date/time.

timeValue2
Nullable<DateTime>

The second date/time.

Returns

The number of seconds between the first and second date/times.

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

Entity Framework 6.2.0
Product Versions
Entity Framework 6.2.0

DiffSeconds(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two date/times.

[System.Data.Entity.DbFunction("Edm", "DiffSeconds")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
public static Nullable<int> DiffSeconds(Nullable<DateTimeOffset> timeValue1, Nullable<DateTimeOffset> timeValue2);

Parameters

timeValue1
Nullable<DateTimeOffset>

The first date/time.

timeValue2
Nullable<DateTimeOffset>

The second date/time.

Returns

The number of seconds between the first and second date/times.

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

Entity Framework 6.2.0
Product Versions
Entity Framework 6.2.0

DiffSeconds(Nullable<TimeSpan>, Nullable<TimeSpan>)

When used as part of a LINQ to Entities query, this method invokes the canonical DiffSeconds EDM function to calculate the number of seconds between two time spans.

[System.Data.Entity.DbFunction("Edm", "DiffSeconds")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue1")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId="timeValue2")]
public static Nullable<int> DiffSeconds(Nullable<TimeSpan> timeValue1, Nullable<TimeSpan> timeValue2);

Parameters

timeValue1
Nullable<TimeSpan>

The first time span.

timeValue2
Nullable<TimeSpan>

The second time span.

Returns

The number of seconds between the first and second time spans.

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

Entity Framework 6.2.0
Product Versions
Entity Framework 6.2.0