SqlMethods.DateDiffMillisecond 方法

定义

计算两个指定日期之间的毫秒边界数。

重载

名称 说明
DateDiffMillisecond(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

计算两个可为 null 日期之间的毫秒边界数。

DateDiffMillisecond(DateTime, DateTime)

计算两个不可为 null 日期之间的毫秒边界数。

DateDiffMillisecond(DateTimeOffset, DateTimeOffset)

计算两个不可为 null 日期之间的毫秒边界数。

DateDiffMillisecond(Nullable<DateTime>, Nullable<DateTime>)

计算两个可为 null 日期之间的毫秒边界数。

注解

对应于使用 DATEDIFF 指定跨越的时间边界类型的 SQL Server millisecond 函数。 有关此SQL Server函数的详细信息,请参阅 DATEDIFF

DateDiffMillisecond(Nullable<DateTimeOffset>, Nullable<DateTimeOffset>)

计算两个可为 null 日期之间的毫秒边界数。

public:
 static Nullable<int> DateDiffMillisecond(Nullable<DateTimeOffset> startDate, Nullable<DateTimeOffset> endDate);
public static int? DateDiffMillisecond(DateTimeOffset? startDate, DateTimeOffset? endDate);
static member DateDiffMillisecond : Nullable<DateTimeOffset> * Nullable<DateTimeOffset> -> Nullable<int>
Public Shared Function DateDiffMillisecond (startDate As Nullable(Of DateTimeOffset), endDate As Nullable(Of DateTimeOffset)) As Nullable(Of Integer)

参数

startDate
Nullable<DateTimeOffset>

时间段的开始日期。

endDate
Nullable<DateTimeOffset>

时间段的结束日期。

返回

如果两个参数都不是 null,则返回两个指定日期之间的毫秒边界数。 当一个或两个参数都是 null时,返回一个 null 值。

注解

对应于使用 DATEDIFF 指定跨越的时间边界类型的 SQL Server millisecond 函数。 有关此SQL Server函数的详细信息,请参阅 DATEDIFF

适用于

DateDiffMillisecond(DateTime, DateTime)

计算两个不可为 null 日期之间的毫秒边界数。

public:
 static int DateDiffMillisecond(DateTime startDate, DateTime endDate);
public static int DateDiffMillisecond(DateTime startDate, DateTime endDate);
static member DateDiffMillisecond : DateTime * DateTime -> int
Public Shared Function DateDiffMillisecond (startDate As DateTime, endDate As DateTime) As Integer

参数

startDate
DateTime

时间段的开始日期。

endDate
DateTime

时间段的结束日期。

返回

两个指定日期之间的毫秒边界数。

注解

对应于使用 DATEDIFF 指定跨越的时间边界类型的 SQL Server millisecond 函数。 有关此SQL Server函数的详细信息,请参阅 DATEDIFF

适用于

DateDiffMillisecond(DateTimeOffset, DateTimeOffset)

计算两个不可为 null 日期之间的毫秒边界数。

public:
 static int DateDiffMillisecond(DateTimeOffset startDate, DateTimeOffset endDate);
public static int DateDiffMillisecond(DateTimeOffset startDate, DateTimeOffset endDate);
static member DateDiffMillisecond : DateTimeOffset * DateTimeOffset -> int
Public Shared Function DateDiffMillisecond (startDate As DateTimeOffset, endDate As DateTimeOffset) As Integer

参数

startDate
DateTimeOffset

时间段的开始日期。

endDate
DateTimeOffset

时间段的结束日期。

返回

两个指定日期之间的毫秒边界数。

注解

对应于使用 DATEDIFF 指定跨越的时间边界类型的 SQL Server millisecond 函数。 有关此SQL Server函数的详细信息,请参阅 DATEDIFF

适用于

DateDiffMillisecond(Nullable<DateTime>, Nullable<DateTime>)

计算两个可为 null 日期之间的毫秒边界数。

public:
 static Nullable<int> DateDiffMillisecond(Nullable<DateTime> startDate, Nullable<DateTime> endDate);
public static int? DateDiffMillisecond(DateTime? startDate, DateTime? endDate);
static member DateDiffMillisecond : Nullable<DateTime> * Nullable<DateTime> -> Nullable<int>
Public Shared Function DateDiffMillisecond (startDate As Nullable(Of DateTime), endDate As Nullable(Of DateTime)) As Nullable(Of Integer)

参数

startDate
Nullable<DateTime>

时间段的开始日期。

endDate
Nullable<DateTime>

时间段的结束日期。

返回

如果两个参数都不是 null,则返回两个指定日期之间的毫秒边界数。 当一个或两个参数都是 null时,返回一个 null 值。

注解

对应于使用 DATEDIFF 指定跨越的时间边界类型的 SQL Server millisecond 函数。 有关此SQL Server函数的详细信息,请参阅 DATEDIFF

适用于