SqlServerDbFunctionsExtensions.DateTimeFromParts 方法

定義

DateTime 結構的新執行個體初始化為指定的年、月、日、時、分、秒和毫秒。 對應至 SQL Server 的 DATETIMEFROMPARTS(year, month, day, hour, minute, second, millisecond)

public static DateTime DateTimeFromParts (this Microsoft.EntityFrameworkCore.DbFunctions _, int year, int month, int day, int hour, int minute, int second, int millisecond);
static member DateTimeFromParts : Microsoft.EntityFrameworkCore.DbFunctions * int * int * int * int * int * int * int -> DateTime
<Extension()>
Public Function DateTimeFromParts (_ As DbFunctions, year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, millisecond As Integer) As DateTime

參數

_
DbFunctions

DbFunctions 執行個體。

year
Int32

年 (1753 到 9999) 。

month
Int32

月份 (1 到 12)。

day
Int32

日 (1 到 month 中的天數)。

hour
Int32

小時 (0 到 23)。

minute
Int32

分鐘 (0 到 59)。

second
Int32

秒數 (0 到 59)。

millisecond
Int32

毫秒 (0 到 999)。

傳回

結構的新實例 DateTime ,指向指定的年份、月、日、小時、分鐘、秒和毫秒。

備註

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

適用於