DateTimeExtendGetInterval Method
取得間隔時間
Namespace: eBizprise.FrameworkAssembly: eBizprise.Framework.DatetimeHelper (in eBizprise.Framework.DatetimeHelper.dll) Version: 25.0.0.0+adf38c4ccb2bf98d8ad258a6278302b5e05a94ed
public static double GetInterval(
this DateTime dateTime,
DateTime compareDateTime,
Interval interval
)
- dateTime DateTime
- DateTime擴充屬性
- compareDateTime DateTime
- 比較日期時間
- interval Interval
- 間隔區間單位
DoubledoubleIn Visual Basic and C#, you can call this method as an instance method on any object of type
DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
取來源日期時間與比對日期時間計算指定的間隔轉換為指定的單位後回傳
DateTime startTime = DateTime.Now;
//執行其餘程式碼
DateTime endTime = DateTime.Now;
double interval = endTime.GetInterval(startTime, DatetimeHelper.Interval.Second);
| Date | Version | Description |
|---|
| 2020/02/07 | 1.0.0.0 | 初版 |
| 2025/09/19 | 25.0.0.0 | 彙整2025年度初版 |