語言

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 到月份的天數)。

hour
Int32

小時 (0 到 23) 。

minute
Int32

分鐘 (0 到 59) 。

second
Int32

秒(0 到 59)。

millisecond
Int32

毫秒(0 到 999)。

傳回

為指定的年份、月份、日、時、分鐘、秒及毫秒建立結構的新實例 DateTime 。

備註

更多資訊與範例請參閱「資料庫函數」及「使用 EF Core 存取 SQL Server 與 Azure SQL 資料庫」。

適用於