Class STimeSpan
- Namespace
- SWConfigDataClientLib.Proxies.ComplexDataTypes
- Assembly
- IpPbxCDSClientLib.dll
__gc container for __var type System.TimeSpan
public class STimeSpan : SComplexBase
- Inheritance
-
STimeSpan
- Inherited Members
Constructors
STimeSpan()
Constructor. The object will not be valid because of having no value.
public STimeSpan()
STimeSpan(int, int, int)
Constructor
public STimeSpan(int hours, int minutes, int seconds)
Parameters
STimeSpan(int, int, int, int)
Constructor
public STimeSpan(int days, int hours, int minutes, int seconds)
Parameters
STimeSpan(int, int, int, int, int)
Constructor
public STimeSpan(int days, int hours, int minutes, int seconds, int milliseconds)
Parameters
Fields
timeSpan
containing timespan
protected TimeSpan timeSpan
Field Value
Properties
Days
Gets the number of whole days represented by the current System.TimeSpan structure.
public int Days { get; }
Property Value
- int
The day component of this instance. The return value can be positive or negative.
Hours
Gets the number of whole hours represented by the current System.TimeSpan structure.
public int Hours { get; }
Property Value
- int
The hour component of the current System.TimeSpan structure. The return value ranges from -23 through 23.
IsZero
Returns true if the value of the the time span is zero
public bool IsZero { get; }
Property Value
Milliseconds
public int Milliseconds { get; }
Property Value
- int
The millisecond component of the current System.TimeSpan structure. The return value ranges from -999 through 999.
Minutes
Gets the number of whole minutes represented by the current System.TimeSpan structure.
public int Minutes { get; }
Property Value
- int
The minute component of the current System.TimeSpan structure. The return value ranges from -59 through 59.
Seconds
Gets the number of whole seconds represented by the current System.TimeSpan structure.
public int Seconds { get; }
Property Value
- int
The second component of the current System.TimeSpan structure. The return value ranges from -59 through 59.
Ticks
Gets the number of ticks that represent the value of the current System.TimeSpan structure.
public long Ticks { get; }
Property Value
- long
The number of ticks contained in this instance.
TotalDays
Gets the value of the current System.TimeSpan structure expressed in whole and fractional days.
public double TotalDays { get; }
Property Value
- double
The total number of days represented by this instance.
TotalHours
Gets the value of the current System.TimeSpan structure expressed in whole and fractional hours.
public double TotalHours { get; }
Property Value
- double
The total number of hours represented by this instance.
TotalMilliseconds
Gets the value of the current System.TimeSpan structure expressed in whole and fractional milliseconds.
public double TotalMilliseconds { get; }
Property Value
- double
The total number of milliseconds represented by this instance.
TotalMinutes
Gets the value of the current System.TimeSpan structure expressed in whole and fractional minutes.
public double TotalMinutes { get; }
Property Value
- double
The total number of minutes represented by this instance.
TotalSeconds
Gets the value of the current System.TimeSpan structure expressed in whole and fractional seconds.
public double TotalSeconds { get; }
Property Value
- double
The total number of seconds represented by this instance.
Methods
FromTicks(long)
public static STimeSpan FromTicks(long value)
Parameters
value
long
Returns
- STimeSpan
A System.TimeSpan with a value of value.
Parse(string)
Constructs a new System.TimeSpan object from a time interval specified in a string.
public static STimeSpan Parse(string s)
Parameters
s
stringA string that specifies a time interval.
Returns
- STimeSpan
A System.TimeSpan that corresponds to s.
Exceptions
- ArgumentNullException
s is null.
- FormatException
s has an invalid format.
- OverflowException
s represents a number less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.-or- At least one of the days, hours, minutes, or seconds components is outside its valid range.
Subtract(STimeSpan)
Subtracts the specified System.TimeSpan from this instance.
public STimeSpan Subtract(STimeSpan ts)
Parameters
ts
STimeSpanA STimeSpan
Returns
- STimeSpan
A System.TimeSpan whose value is the result of the value of this instance minus the value of ts.
Exceptions
- OverflowException
The return value is less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue.
ToString()
Returns the string representation of the value of this instance.
public override string ToString()
Returns
- string
A string that represents the value of this instance. The return value is of the form: [-][d.]hh:mm:ss[.ff] Items in square brackets ([ and ]) are optional, colons and periods (: and.) are literal characters; and the other items are as follows.Item Description "-" optional minus sign indicating a negative time "d" optional days "hh" hours, ranging from 0 to 23 "mm" minutes, ranging from 0 to 59 "ss" seconds, ranging from 0 to 59 "ff" optional fractional seconds, from 1 to 7 decimal digits For more information about comparing the string representation of System.TimeSpan and Oracle data types, see article Q324577, "System.TimeSpan Does Not Match Oracle 9i INTERVAL DAY TO SECOND Data Type," in the Microsoft Knowledge Base at http://support.microsoft.com.
TryParse(string, out STimeSpan)
Constructs a new System.TimeSpan object from a time interval specified in a string. Parameters specify the time interval and the variable where the new System.TimeSpan object is returned.
public static bool TryParse(string s, out STimeSpan result)
Parameters
s
stringA string that specifies a time interval.
result
STimeSpanWhen this method returns, contains an object that represents the time interval specified by s. IsZero will be true if the conversion failed. This parameter is passed uninitialized.
Returns
- bool
true if s was converted successfully; otherwise, false. This operation returns false if the s parameter is null, has an invalid format,represents a time interval less than System.TimeSpan.MinValue or greater than System.TimeSpan.MaxValue, or has at least one days, hours, minutes, or seconds component outside its valid range.