SqlServerDbFunctionsExtensions.DateDiffSecond 方法

定義

多載

DateDiffSecond(DbFunctions, DateOnly, DateOnly)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, DateTime, DateTime)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

DateDiffSecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>)

計算 與 endTime 之間 startTime 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTime, @endTime)

DateDiffSecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>)

計算 與 endTimeSpan 之間 startTimeSpan 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTimeSpan, @endTimeSpan)

DateDiffSecond(DbFunctions, TimeOnly, TimeOnly)

計算 與 endTime 之間 startTime 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTime, @endTime)

DateDiffSecond(DbFunctions, TimeSpan, TimeSpan)

計算 與 endTimeSpan 之間 startTimeSpan 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTimeSpan, @endTimeSpan)

DateDiffSecond(DbFunctions, DateOnly, DateOnly)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly startDate, DateOnly endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * DateOnly * DateOnly -> int
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As DateOnly, endDate As DateOnly) As Integer

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
DateOnly

計算的開始日期。

endDate
DateOnly

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, DateTime, DateTime)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime startDate, DateTime endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * DateTime * DateTime -> int
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As DateTime, endDate As DateTime) As Integer

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
DateTime

計算的開始日期。

endDate
DateTime

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset startDate, DateTimeOffset endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * DateTimeOffset * DateTimeOffset -> int
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As DateTimeOffset, endDate As DateTimeOffset) As Integer

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
DateTimeOffset

計算的開始日期。

endDate
DateTimeOffset

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int? DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateOnly? startDate, DateOnly? endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateOnly> * Nullable<DateOnly> -> Nullable<int>
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As Nullable(Of DateOnly), endDate As Nullable(Of DateOnly)) As Nullable(Of Integer)

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
Nullable<DateOnly>

計算的開始日期。

endDate
Nullable<DateOnly>

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int? DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTime? startDate, DateTime? endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
Nullable<DateTime>

計算的開始日期。

endDate
Nullable<DateTime>

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

計算 與 endDate 之間 startDate 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startDate, @endDate)

public static int? DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, DateTimeOffset? startDate, DateTimeOffset? endDate);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

參數

_
DbFunctions

DbFunctions 執行個體。

startDate
Nullable<DateTimeOffset>

計算的開始日期。

endDate
Nullable<DateTimeOffset>

計算的結束日期。

傳回

日期之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>)

計算 與 endTime 之間 startTime 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTime, @endTime)

public static int? DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, TimeOnly? startTime, TimeOnly? endTime);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<TimeOnly> * Nullable<TimeOnly> -> Nullable<int>
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startTime As Nullable(Of TimeOnly), endTime As Nullable(Of TimeOnly)) As Nullable(Of Integer)

參數

_
DbFunctions

DbFunctions 執行個體。

startTime
Nullable<TimeOnly>

計算的開始時間。

endTime
Nullable<TimeOnly>

計算的結束時間。

傳回

在時間之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>)

計算 與 endTimeSpan 之間 startTimeSpan 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTimeSpan, @endTimeSpan)

public static int? DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, TimeSpan? startTimeSpan, TimeSpan? endTimeSpan);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * Nullable<TimeSpan> * Nullable<TimeSpan> -> Nullable<int>
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startTimeSpan As Nullable(Of TimeSpan), endTimeSpan As Nullable(Of TimeSpan)) As Nullable(Of Integer)

參數

_
DbFunctions

DbFunctions 執行個體。

startTimeSpan
Nullable<TimeSpan>

計算的開始時間範圍。

endTimeSpan
Nullable<TimeSpan>

計算的結束時間範圍。

傳回

時間範圍之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, TimeOnly, TimeOnly)

計算 與 endTime 之間 startTime 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTime, @endTime)

public static int DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, TimeOnly startTime, TimeOnly endTime);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * TimeOnly * TimeOnly -> int
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startTime As TimeOnly, endTime As TimeOnly) As Integer

參數

_
DbFunctions

DbFunctions 執行個體。

startTime
TimeOnly

計算的開始時間。

endTime
TimeOnly

計算的結束時間。

傳回

在時間之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於

DateDiffSecond(DbFunctions, TimeSpan, TimeSpan)

計算 與 endTimeSpan 之間 startTimeSpan 跨越的第二個界限數目。 對應至SQL Server 的 DATEDIFF(second, @startTimeSpan, @endTimeSpan)

public static int DateDiffSecond (this Microsoft.EntityFrameworkCore.DbFunctions _, TimeSpan startTimeSpan, TimeSpan endTimeSpan);
static member DateDiffSecond : Microsoft.EntityFrameworkCore.DbFunctions * TimeSpan * TimeSpan -> int
<Extension()>
Public Function DateDiffSecond (_ As DbFunctions, startTimeSpan As TimeSpan, endTimeSpan As TimeSpan) As Integer

參數

_
DbFunctions

DbFunctions 執行個體。

startTimeSpan
TimeSpan

計算的開始時間範圍。

endTimeSpan
TimeSpan

計算的結束時間範圍。

傳回

時間範圍之間跨越的第二個界限數目。

備註

如需詳細資訊和範例,請參閱使用EF Core 存取SQL Server和Azure SQL資料庫

適用於