SqlServerDbFunctionsExtensions.DateTime2FromParts 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将结构的新实例 DateTime 初始化为指定的年份、月、日、小时、分钟、秒、分数和精度。
对应于SQL Server的 DATETIME2FROMPARTS(year, month, day, hour, minute, seconds, fractions, precision)。
public static DateTime DateTime2FromParts(this Microsoft.EntityFrameworkCore.DbFunctions _, int year, int month, int day, int hour, int minute, int second, int fractions, int precision);
static member DateTime2FromParts : Microsoft.EntityFrameworkCore.DbFunctions * int * int * int * int * int * int * int * int -> DateTime
<Extension()>
Public Function DateTime2FromParts (_ As DbFunctions, year As Integer, month As Integer, day As Integer, hour As Integer, minute As Integer, second As Integer, fractions As Integer, precision As Integer) As DateTime
参数
DbFunctions 实例。
- year
- Int32
年份(1753至9999年)。
- month
- Int32
月份(1 至 12)。
- day
- Int32
日期(1 到月份中的天数)。
- hour
- Int32
小时数(0 到 23)。
- minute
- Int32
分钟数(0 到 59)。
- second
- Int32
秒(0 到 59)。
- fractions
- Int32
小数秒(0 到9999999)。
- precision
- Int32
datetime2 值的精度(0 到 7)。
返回
结构的新实例 DateTime ,以指定年份、月、日、小时、分钟、秒、分数和精度。
注解
有关详细信息和示例,请参阅数据库函数以及使用 EF Core 访问SQL Server和Azure SQL数据库。