TimeSpan 結構

定義

表示時間間隔。

public value class TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable
public value class TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, ISpanFormattable
public value class TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IParsable<TimeSpan>, ISpanFormattable, ISpanParsable<TimeSpan>
public value class TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IParsable<TimeSpan>, ISpanFormattable, ISpanParsable<TimeSpan>, IUtf8SpanFormattable
public value class TimeSpan : IComparable
public value class TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable
public readonly struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable
public readonly struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, ISpanFormattable
public readonly struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IParsable<TimeSpan>, ISpanFormattable, ISpanParsable<TimeSpan>
public readonly struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IParsable<TimeSpan>, ISpanFormattable, ISpanParsable<TimeSpan>, IUtf8SpanFormattable
[System.Serializable]
public struct TimeSpan : IComparable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan>, IFormattable
type TimeSpan = struct
    interface IFormattable
type TimeSpan = struct
    interface ISpanFormattable
    interface IFormattable
type TimeSpan = struct
    interface IFormattable
    interface IParsable<TimeSpan>
    interface ISpanFormattable
    interface ISpanParsable<TimeSpan>
type TimeSpan = struct
    interface IFormattable
    interface IParsable<TimeSpan>
    interface ISpanFormattable
    interface ISpanParsable<TimeSpan>
    interface IUtf8SpanFormattable
[<System.Serializable>]
type TimeSpan = struct
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TimeSpan = struct
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type TimeSpan = struct
    interface IFormattable
Public Structure TimeSpan
Implements IComparable, IComparable(Of TimeSpan), IEquatable(Of TimeSpan), IFormattable
Public Structure TimeSpan
Implements IComparable, IComparable(Of TimeSpan), IEquatable(Of TimeSpan), ISpanFormattable
Public Structure TimeSpan
Implements IComparable, IComparable(Of TimeSpan), IEquatable(Of TimeSpan), IParsable(Of TimeSpan), ISpanFormattable, ISpanParsable(Of TimeSpan)
Public Structure TimeSpan
Implements IComparable, IComparable(Of TimeSpan), IEquatable(Of TimeSpan), IParsable(Of TimeSpan), ISpanFormattable, ISpanParsable(Of TimeSpan), IUtf8SpanFormattable
Public Structure TimeSpan
Implements IComparable
Public Structure TimeSpan
Implements IComparable, IComparable(Of TimeSpan), IEquatable(Of TimeSpan)
繼承
TimeSpan
屬性
實作

範例

下列範例會具現化 代表兩個 TimeSpan 日期之間差異的物件。 然後,它會顯示 TimeSpan 對象的屬性。

// Define two dates.
DateTime date1 = new DateTime(2010, 1, 1, 8, 0, 15);
DateTime date2 = new DateTime(2010, 8, 18, 13, 30, 30);

// Calculate the interval between the two dates.
TimeSpan interval = date2 - date1;
Console.WriteLine("{0} - {1} = {2}", date2, date1, interval.ToString());

// Display individual properties of the resulting TimeSpan object.
Console.WriteLine("   {0,-35} {1,20}", "Value of Days Component:", interval.Days);
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Days:", interval.TotalDays);
Console.WriteLine("   {0,-35} {1,20}", "Value of Hours Component:", interval.Hours);
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Hours:", interval.TotalHours);
Console.WriteLine("   {0,-35} {1,20}", "Value of Minutes Component:", interval.Minutes);
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Minutes:", interval.TotalMinutes);
Console.WriteLine("   {0,-35} {1,20:N0}", "Value of Seconds Component:", interval.Seconds);
Console.WriteLine("   {0,-35} {1,20:N0}", "Total Number of Seconds:", interval.TotalSeconds);
Console.WriteLine("   {0,-35} {1,20:N0}", "Value of Milliseconds Component:", interval.Milliseconds);
Console.WriteLine("   {0,-35} {1,20:N0}", "Total Number of Milliseconds:", interval.TotalMilliseconds);
Console.WriteLine("   {0,-35} {1,20:N0}", "Ticks:", interval.Ticks);

// This example displays the following output:
//       8/18/2010 1:30:30 PM - 1/1/2010 8:00:15 AM = 229.05:30:15
//          Value of Days Component:                             229
//          Total Number of Days:                   229.229340277778
//          Value of Hours Component:                              5
//          Total Number of Hours:                  5501.50416666667
//          Value of Minutes Component:                           30
//          Total Number of Minutes:                       330090.25
//          Value of Seconds Component:                           15
//          Total Number of Seconds:                      19,805,415
//          Value of Milliseconds Component:                       0
//          Total Number of Milliseconds:             19,805,415,000
//          Ticks:                               198,054,150,000,000
// Define two dates.
let date1 = DateTime(2010, 1, 1, 8, 0, 15)
let date2 = DateTime(2010, 8, 18, 13, 30, 30)

// Calculate the interval between the two dates.
let interval = date2 - date1
printfn $"{date2} - {date1} = {interval}"

// Display individual properties of the resulting TimeSpan object.
printfn $"""   {"Value of Days Component:",-35} {interval.Days,20}""" 
printfn $"""   {"Total Number of Days:",-35} {interval.TotalDays,20}""" 
printfn $"""   {"Value of Hours Component:",-35} {interval.Hours,20}""" 
printfn $"""   {"Total Number of Hours:",-35} {interval.TotalHours,20}""" 
printfn $"""   {"Value of Minutes Component:",-35} {interval.Minutes,20}""" 
printfn $"""   {"Total Number of Minutes:",-35} {interval.TotalMinutes,20}""" 
printfn $"""   {"Value of Seconds Component:",-35} {interval.Seconds,20:N0}""" 
printfn $"""   {"Total Number of Seconds:",-35} {interval.TotalSeconds,20:N0}""" 
printfn $"""   {"Value of Milliseconds Component:",-35} {interval.Milliseconds,20:N0}""" 
printfn $"""   {"Total Number of Milliseconds:",-35} {interval.TotalMilliseconds,20:N0}""" 
printfn $"""   {"Ticks:",-35} {interval.Ticks,20:N0}""" 

// This example displays the following output:
//       8/18/2010 1:30:30 PM - 1/1/2010 8:00:15 AM = 229.05:30:15
//          Value of Days Component:                             229
//          Total Number of Days:                   229.229340277778
//          Value of Hours Component:                              5
//          Total Number of Hours:                  5501.50416666667
//          Value of Minutes Component:                           30
//          Total Number of Minutes:                       330090.25
//          Value of Seconds Component:                           15
//          Total Number of Seconds:                      19,805,415
//          Value of Milliseconds Component:                       0
//          Total Number of Milliseconds:             19,805,415,000
//          Ticks:                               198,054,150,000,000
' Define two dates.
Dim date1 As Date = #1/1/2010 8:00:15AM#
Dim date2 As Date = #8/18/2010 1:30:30PM#
' Calculate the interval between the two dates.
Dim interval As TimeSpan = date2 - date1
Console.WriteLine("{0} - {1} = {2}", date2, date1, interval.ToString())
' Display individual properties of the resulting TimeSpan object.
Console.WriteLine("   {0,-35} {1,20}", "Value of Days Component:", interval.Days)
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Days:", interval.TotalDays)
Console.WriteLine("   {0,-35} {1,20}", "Value of Hours Component:", interval.Hours)
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Hours:", interval.TotalHours)
Console.WriteLine("   {0,-35} {1,20}", "Value of Minutes Component:", interval.Minutes)
Console.WriteLine("   {0,-35} {1,20}", "Total Number of Minutes:", interval.TotalMinutes)
Console.WriteLine("   {0,-35} {1,20:N0}", "Value of Seconds Component:", interval.Seconds)
Console.WriteLine("   {0,-35} {1,20:N0}", "Total Number of Seconds:", interval.TotalSeconds)
Console.WriteLine("   {0,-35} {1,20:N0}", "Value of Milliseconds Component:", interval.Milliseconds)
Console.WriteLine("   {0,-35} {1,20:N0}", "Total Number of Milliseconds:", interval.TotalMilliseconds)
Console.WriteLine("   {0,-35} {1,20:N0}", "Ticks:", interval.Ticks)
' The example displays the following output:
'       8/18/2010 1:30:30 PM - 1/1/2010 8:00:15 AM = 229.05:30:15
'          Value of Days Component:                             229
'          Total Number of Days:                   229.229340277778
'          Value of Hours Component:                              5
'          Total Number of Hours:                  5501.50416666667
'          Value of Minutes Component:                           30
'          Total Number of Minutes:                       330090.25
'          Value of Seconds Component:                           15
'          Total Number of Seconds:                      19,805,415
'          Value of Milliseconds Component:                       0
'          Total Number of Milliseconds:             19,805,415,000
'          Ticks:                               198,054,150,000,000
# Define two dates.
$Date2 = Get-Date -Date '2010/8/18' -Hour 13 -Minute 30 -Second 30
$Date1 = Get-Date -Date '2010/1/1'  -Hour 8  -Minute 0  -Second 15

# Calculate the interval between the two dates.
$Interval = $Date2 - $Date1
"{0} - {1} = {2}" -f $Date2, $Date1, ($Interval.ToString())

#  Display individual properties of the resulting TimeSpan object.
"   {0,-35} {1,20}"    -f "Value of Days Component:", $Interval.Days
"   {0,-35} {1,20}"    -f "Total Number of Days:", $Interval.TotalDays
"   {0,-35} {1,20}"    -f "Value of Hours Component:", $Interval.Hours
"   {0,-35} {1,20}"    -f "Total Number of Hours:", $Interval.TotalHours
"   {0,-35} {1,20}"    -f "Value of Minutes Component:", $Interval.Minutes
"   {0,-35} {1,20}"    -f "Total Number of Minutes:", $Interval.TotalMinutes
"   {0,-35} {1,20:N0}" -f "Value of Seconds Component:", $Interval.Seconds
"   {0,-35} {1,20:N0}" -f "Total Number of Seconds:", $Interval.TotalSeconds
"   {0,-35} {1,20:N0}" -f "Value of Milliseconds Component:", $Interval.Milliseconds
"   {0,-35} {1,20:N0}" -f "Total Number of Milliseconds:", $Interval.TotalMilliseconds
"   {0,-35} {1,20:N0}" -f "Ticks:", $Interval.Ticks

<# This sample produces the following output:

18/08/2010 13:30:30 - 01/01/2010 08:00:15 = 229.05:30:15
   Value of Days Component:                             229
   Total Number of Days:                   229.229340277778
   Value of Hours Component:                              5
   Total Number of Hours:                  5501.50416666667
   Value of Minutes Component:                           30
   Total Number of Minutes:                       330090.25
   Value of Seconds Component:                           15
   Total Number of Seconds:                      19,805,415
   Value of Milliseconds Component:                       0
   Total Number of Milliseconds:             19,805,415,000
   Ticks:                               198,054,150,000,000
#>

備註

如需此 API 的詳細資訊,請參閱 TimeSpan 的補充 API 備註

建構函式

TimeSpan(Int32, Int32, Int32)

TimeSpan 結構的新執行個體初始化為指定的時數、分鐘數和秒數。

TimeSpan(Int32, Int32, Int32, Int32)

TimeSpan 結構的新執行個體初始化為指定的天數、時數、分鐘數和秒數。

TimeSpan(Int32, Int32, Int32, Int32, Int32)

TimeSpan 結構的新執行個體初始化為指定的天數、時數、分鐘數、秒數和毫秒數。

TimeSpan(Int32, Int32, Int32, Int32, Int32, Int32)

將結構的新實例 TimeSpan 初始化為指定的天數、小時、分鐘、秒、毫秒和微秒。

TimeSpan(Int64)

TimeSpan 結構的新執行個體初始化為刻度的指定數目。

欄位

MaxValue

代表最大 TimeSpan 值。 此欄位為唯讀。

MinValue

代表最小 TimeSpan 值。 此欄位為唯讀。

NanosecondsPerTick

表示每個刻度數的奈秒數。 這個欄位為常數。

TicksPerDay

表示 1 天中的刻度數。 這個欄位為常數。

TicksPerHour

表示 1 小時中的刻度數。 這個欄位為常數。

TicksPerMicrosecond

表示以1毫秒為單位的刻度數。 這個欄位為常數。

TicksPerMillisecond

表示 1 毫秒中的刻度數。 這個欄位為常數。

TicksPerMinute

表示 1 分鐘中的刻度數。 這個欄位為常數。

TicksPerSecond

表示 1 秒中的刻度數。

Zero

代表零 TimeSpan 值。 此欄位為唯讀。

屬性

Days

取得目前 TimeSpan 結構所表示之時間間隔的天數元件。

Hours

取得目前 TimeSpan 結構所表示之時間間隔的時數元件。

Microseconds

取得目前 TimeSpan 結構所表示之時間間隔的微秒元件。

Milliseconds

取得目前 TimeSpan 結構所表示之時間間隔的毫秒數元件。

Minutes

取得目前 TimeSpan 結構所表示之時間間隔的分鐘數元件。

Nanoseconds

取得目前 TimeSpan 結構所表示之時間間隔的 nanoseconds 元件。

Seconds

取得目前 TimeSpan 結構所表示之時間間隔的秒數元件。

Ticks

取得刻度數,表示目前 TimeSpan 結構的值。

TotalDays

取得目前 TimeSpan 結構的值,這個值以整數和小數的天數表示。

TotalHours

取得目前 TimeSpan 結構的值,這個值以整數和小數的時數表示。

TotalMicroseconds

取得以整數和小數微秒表示的目前 TimeSpan 結構值。

TotalMilliseconds

取得目前 TimeSpan 結構的值,這個值以整數和小數的毫秒數表示。

TotalMinutes

取得目前 TimeSpan 結構的值,這個值以整數和小數的分鐘數表示。

TotalNanoseconds

取得以整數和小數奈秒表示的目前 TimeSpan 結構值。

TotalSeconds

取得目前 TimeSpan 結構的值,這個值以整數和小數的秒數表示。

方法

Add(TimeSpan)

傳回新的 TimeSpan 物件,它的值為指定之 TimeSpan 物件與這個執行個體的總和。

Compare(TimeSpan, TimeSpan)

比較兩個 TimeSpan 值並傳回整數,這個整數會指出第一個值比第二個值短、等長或較長。

CompareTo(Object)

比較這個執行個體和指定的物件,並傳回一個整數,表示這個執行個體短於、等於或長於指定的物件。

CompareTo(TimeSpan)

比較這個執行個體和指定的 TimeSpan 物件,並傳回一個整數,表示這個執行個體短於、等於或長於 TimeSpan 物件。

Divide(Double)

傳回新的 TimeSpan 物件,其值為將這個實例除以指定的 divisor的結果。

Divide(TimeSpan)

傳回新的 Double 值,這是將此實例除以 ts的結果。

Duration()

傳回新的 TimeSpan 物件,其值為目前 TimeSpan 物件的絕對值。

Equals(Object)

傳回值,該值表示這個執行個體是否和指定的物件相等。

Equals(TimeSpan)

傳回表示這個執行個體是否等於指定 TimeSpan 物件的值。

Equals(TimeSpan, TimeSpan)

傳回值,這個值表示兩個指定的 TimeSpan 執行個體是否相等。

FromDays(Double)

傳回表示指定天數的 TimeSpan,其規格的精確度達到最接近的毫秒數。

FromHours(Double)

傳回表示指定時數的 TimeSpan,其規格的精確度達到最接近的毫秒數。

FromMicroseconds(Double)

傳回 , TimeSpan 表示指定的微秒數。

FromMilliseconds(Double)

傳回表示指定毫秒數的 TimeSpan

FromMinutes(Double)

傳回表示指定分鐘數的 TimeSpan,其規格的精確度達到最接近的毫秒數。

FromSeconds(Double)

傳回表示指定秒數的 TimeSpan,其規格的精確度達到最接近的毫秒數。

FromTicks(Int64)

傳回表示指定時間的 TimeSpan,其規格是以刻度為單位。

GetHashCode()

傳回這個執行個體的雜湊碼。

Multiply(Double)

傳回新的 TimeSpan 物件,其值是此執行個體與指定 factor 相乘後的結果。

Negate()

傳回新 TimeSpan 物件,其值是這個執行個體的相反值。

Parse(ReadOnlySpan<Char>, IFormatProvider)

使用指定的特定文化特性格式資訊,將時間間隔的範圍表示轉換為其對等的 TimeSpan

Parse(String)

將時間間隔的字串表示,轉換成與其相等的 TimeSpan

Parse(String, IFormatProvider)

使用指定的特定文化特性格式資訊,將時間間隔的字串表示轉換為其相等的 TimeSpan

ParseExact(ReadOnlySpan<Char>, ReadOnlySpan<Char>, IFormatProvider, TimeSpanStyles)

使用指定格式和特定文化特性格式資訊,將時間間隔的字元範圍轉換為其對等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

ParseExact(ReadOnlySpan<Char>, String[], IFormatProvider, TimeSpanStyles)

使用指定之格式、特定文件特性格式資訊和樣式,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

ParseExact(String, String, IFormatProvider)

使用指定之格式和特定文化特性格式資訊,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

ParseExact(String, String, IFormatProvider, TimeSpanStyles)

使用指定之格式、特定文件特性格式資訊和樣式,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

ParseExact(String, String[], IFormatProvider)

使用指定之格式字串的陣列和特定文件特性格式資訊,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

ParseExact(String, String[], IFormatProvider, TimeSpanStyles)

使用指定之格式、特定文件特性格式資訊和樣式,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

Subtract(TimeSpan)

傳回新的 TimeSpan 物件,它的值為指定之 TimeSpan 物件與這個執行個體的差。

ToString()

將目前 TimeSpan 物件的值,轉換為其相等的字串表示。

ToString(String)

使用指定的格式,將目前 TimeSpan 物件的值,轉換為其相等字串表示。

ToString(String, IFormatProvider)

使用指定的格式和特定文件特性格式資訊,將目前 TimeSpan 物件的值,轉換為其相等的字串表示。

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)

嘗試將目前實例的值格式化為UTF-8到提供的位元組範圍。

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)

嘗試將目前時間範圍數字執行個體的值格式化為所提供的字元範圍。

TryParse(ReadOnlySpan<Char>, IFormatProvider, TimeSpan)

使用指定的特定文件特性格式資訊,將時間間隔的範圍表示轉換為其對等的 TimeSpan,並傳回值以指出轉換是否成功。

TryParse(ReadOnlySpan<Char>, TimeSpan)

將時間間隔的範圍表示轉換為其對等的 TimeSpan,並傳回值以指出轉換是否成功。

TryParse(String, IFormatProvider, TimeSpan)

使用指定的特定文件特性格式資訊,將時間間隔的字串表示轉換為其相等的 TimeSpan,並傳回表示轉換是否成功的值。

TryParse(String, TimeSpan)

將時間間隔的字串表示,轉換為其相等的 TimeSpan,並傳回一個值表示轉換是否成功。

TryParseExact(ReadOnlySpan<Char>, ReadOnlySpan<Char>, IFormatProvider, TimeSpan)

使用指定的格式和文化特性專屬格式資訊,將時間間隔的指定範圍表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

TryParseExact(ReadOnlySpan<Char>, ReadOnlySpan<Char>, IFormatProvider, TimeSpanStyles, TimeSpan)

使用指定格式、特定文件特性格式資訊及樣式,將指定的時間間隔範圍表示轉換為其對等的 TimeSpan,並傳回值以指出轉換是否成功。 字串表示的格式必須完全符合指定的格式。

TryParseExact(ReadOnlySpan<Char>, String[], IFormatProvider, TimeSpan)

使用指定的格式和文化特性專屬格式資訊,將時間間隔的指定範圍表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

TryParseExact(ReadOnlySpan<Char>, String[], IFormatProvider, TimeSpanStyles, TimeSpan)

使用指定的格式、文化特性專屬格式資訊及樣式,將時間間隔的指定範圍表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

TryParseExact(String, String, IFormatProvider, TimeSpan)

使用指定之格式和特定文化特性格式資訊,將時間間隔的字串表示轉換為其相等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

TryParseExact(String, String, IFormatProvider, TimeSpanStyles, TimeSpan)

使用指定的格式、文化特性專屬格式資訊及樣式,將時間間隔的指定字串表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合指定的格式。

TryParseExact(String, String[], IFormatProvider, TimeSpan)

使用指定的格式和文化特性專屬格式資訊,將時間間隔的指定字串表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

TryParseExact(String, String[], IFormatProvider, TimeSpanStyles, TimeSpan)

使用指定的格式、文化特性專屬格式資訊及樣式,將時間間隔的指定字串表示法轉換成對等的 TimeSpan。 字串表示的格式必須完全符合其中一個指定的格式。

運算子

Addition(TimeSpan, TimeSpan)

加入兩個指定的 TimeSpan 執行個體。

Division(TimeSpan, Double)

傳回新的 TimeSpan 物件,其值是除以指定 之所指定 timeSpandivisor的結果。

Division(TimeSpan, TimeSpan)

傳回新的 Double 值,這是除 t1t2的結果。

Equality(TimeSpan, TimeSpan)

表示兩個 TimeSpan 執行個體是否相等。

GreaterThan(TimeSpan, TimeSpan)

表示指定的 TimeSpan 是否大於另一個指定的 TimeSpan

GreaterThanOrEqual(TimeSpan, TimeSpan)

表示指定的 TimeSpan 是否大於或等於另一個指定的 TimeSpan

Inequality(TimeSpan, TimeSpan)

表示兩個 TimeSpan 執行個體是否不相等。

LessThan(TimeSpan, TimeSpan)

表示指定的 TimeSpan 是否小於另一個指定的 TimeSpan

LessThanOrEqual(TimeSpan, TimeSpan)

表示指定的 TimeSpan 是否小於或等於另一個指定的 TimeSpan

Multiply(Double, TimeSpan)

傳回新的 TimeSpan 物件,其值是指定的 factor 與指定的 timeSpan 執行個體相乘後的結果。

Multiply(TimeSpan, Double)

傳回新的 TimeSpan 物件,其值是指定的 timeSpan 執行個體與指定 factor 相乘後的結果。

Subtraction(TimeSpan, TimeSpan)

將指定的 TimeSpan 從另一個指定的 TimeSpan 減掉。

UnaryNegation(TimeSpan)

傳回 TimeSpan,其值是指定執行個體的相反值。

UnaryPlus(TimeSpan)

傳回 TimeSpan 的指定執行個體。

明確介面實作

IComparable.CompareTo(Object)

比較這個執行個體和指定的物件,並傳回一個整數,表示這個執行個體短於、等於或長於指定的物件。

適用於

另請參閱