SqlServerDbFunctionsExtensions.DateDiffSecond 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| DateDiffSecond(DbFunctions, TimeSpan, TimeSpan) |
計算 與 |
| DateDiffSecond(DbFunctions, TimeOnly, TimeOnly) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<TimeSpan>, Nullable<TimeSpan>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<TimeOnly>, Nullable<TimeOnly>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateTimeOffset>, Nullable<DateTimeOffset>) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateOnly>, Nullable<DateOnly>) |
計算 與 |
| DateDiffSecond(DbFunctions, DateTimeOffset, DateTimeOffset) |
計算 與 |
| DateDiffSecond(DbFunctions, DateTime, DateTime) |
計算 與 |
| DateDiffSecond(DbFunctions, DateOnly, DateOnly) |
計算 與 |
| DateDiffSecond(DbFunctions, Nullable<DateTime>, Nullable<DateTime>) |
計算 與 |
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 執行個體。
- startTimeSpan
- TimeSpan
計算的起始時間跨度。
- endTimeSpan
- 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 執行個體。
- startTime
- TimeOnly
計算開始時間。
- endTime
- 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 執行個體。
傳回
跨越的第二邊界數。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 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 執行個體。
傳回
兩次跨越的第二界線數。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 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 執行個體。
- startDate
- Nullable<DateTimeOffset>
計算開始日期。
- endDate
- Nullable<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 執行個體。
傳回
跨越第二邊界的數量。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 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 執行個體。
- startDate
- DateTimeOffset
計算開始日期。
- endDate
- DateTimeOffset
計算的結束日期。
傳回
跨越第二邊界的數量。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 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 執行個體。
- startDate
- DateTime
計算開始日期。
- endDate
- DateTime
計算的結束日期。
傳回
跨越第二邊界的數量。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。
適用於
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 執行個體。
- startDate
- DateOnly
計算開始日期。
- endDate
- 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 執行個體。
傳回
跨越第二邊界的數量。
備註
更多資訊與範例請參閱「資料庫函數」及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。