IfxTimeSpan public methods

These are the methods of the IfxTimeSpan object.

IfxTimeSpan.Add

IfxTimeSpan IfxTimeSpan.Add(IfxTimeSpan ts)

Returns a new IfxTimeSpan set to the value of the this instance plus the amount of time in ts.

The resulting IfxTimeSpan has the same range as this instance. This instance is not changed.

IfxTimeSpan.Compare

static System.Int32 IfxTimeSpan.Compare(IfxTimeSpan ts1, IfxTimeSpan ts2)

This method does not compare the relative sizes of the spans, rather the IfxTimeSpan objects are compared as if they were both numbers. This means, for instance, that a span of -12 hours is less than a span of 2 hours.

Returns a value based on the relative values of ts1 and ts2.
-1
ts1 is less than ts2
0
ts1 and ts2 have the same value
1
ts1 is greater than ts2

Objects in the HCL® OneDB® .NET Core Provider consider two null values to be equal to each other. They also consider a null value to be less than any non-null value.

IfxTimeSpan.CompareTo

System.Boolean IfxTimeSpan.CompareTo(System.Object obj)

The object obj must be an IfxTimeSpan.

This is equivalent to calling IfxTimeSpan.Compare with the IfxTimeSpan as ts1 and obj as ts2.

IfxTimeSpan.Divide

IfxTimeSpan IfxTimeSpan.Divide(Decimal val)
Returns a new IfxTimeSpan set to the original IfxTimeSpan divided by val.
IfxTimeSpan IfxTimeSpan.Divide(IfxTimeSpan ts)
Returns the number of spans of time that are the size of ts that will fit in the span of time represented by this instance of IfxTimeSpan. The result is negative if one of the IfxTimeSpan objects is negative and the other is not.

IfxTimeSpan.Duration

IfxTimeSpan IfxTimeSpan.Duration()

Returns a new IfxTimeSpan with a value that is the absolute value of this instance.

IfxTimeSpan.Equals

static Boolean IfxTimeSpan.Equals(IfxTimeSpan ts1, IfxTimeSpan ts2)
Returns true if ts1 and ts2 have the same value; otherwise returns false.
Boolean IfxTimeSpan.Equals(System.Object obj)
Returns true if obj is an IfxTimeSpan that has the same value as this instance; otherwise it returns false.

IfxTimeSpan.GetHashCode

System.Int32 IfxTimeSpan.GetHashCode()

Returns the hash code for this IfxTimeSpan.

The hash code will be the same for any two IfxTimeSpan objects that have the same value but might also be the same for two IfxTimeSpan objects with different values.

See the description of the Object.GetHashCode method in the .NET Framework Class Library for details about hash codes.

IfxTimeSpan.GreaterThan

static System.Boolean IfxTimeSpan.GreaterThan(IfxTimeSpan ts1, IfxTimeSpan ts2)

Returns true if IfxTimeSpan.Compare( ts1, ts2 ) would return 1. Otherwise, it returns false.

IfxTimeSpan.GreaterThanOrEqual

static System.Boolean IfxTimeSpan.GreaterThanOrEqual(IfxTimeSpan ts1, IfxTimeSpan 
ts2)

Returns true if IfxTimeSpan.Compare(ts1, ts2) would return either 1 or 0. Otherwise, it is false.

IfxTimeSpan.LessThan

System.Boolean IfxTimeSpan.LessThan(IfxTimeSpan ts1, IfxTimeSpan ts2)

Returns true if IfxTimeSpan.Compare( ts1, ts2 ) would return -1. Otherwise, it returns false.

IfxTimeSpan.LessThanOrEqual

System.Boolean IfxTimeSpan.LessThanOrEqual(IfxTimeSpan ts1, IfxTimeSpan ts2)

Returns true if IfxTimeSpan.Compare( ts1, ts2 ) would return -1 or 0. Otherwise, it returns false.

IfxTimeSpan.Negate

IfxTimeSpan IfxTimeSpan.Negate()

Returns a new IfxTimeSpan with a value equal to this instance but with opposite sign (positive or negative).

IfxTimeSpan.NotEquals

static System.Boolean IfxTimeSpan.NotEquals(IfxTimeSpan ts1, IfxTimeSpan ts2)

Returns true if IfxTimeSpan.Compare(ts1, ts2) would return -1 or 1. Otherwise, it returns false.

IfxTimeSpan.Parse

static IfxTimeSpan IfxTimeSpan.Parse(System.String _szTime)
static IfxTimeSpan IfxTimeSpan.Parse(System.String _szTime, 
IfxTimeUnit start, IfxTimeUnit end)
static IfxTimeSpan IfxTimeSpan.Parse(System.String _szTime, System.String format, 
IfxTimeUnit start, IfxTimeUnit end)
Returns a new IfxTimeSpan with a value based on _szTime. If format is not given, the _szTime string must be in this format:
[-]d h:m:s.f
-
Optional sign. If this is present the IfxTimeSpan will be negative. The brackets ([]) indicate that the sign is optional. They are not part of the format.
d
An integer indicating the number of days. This must be an integer in the range 0 to 999 999 999.
h
The number of hours. This must be an integer in the range 0 to 23.
m
The number of minutes. This must be an integer in the range 0 to 59.
s
The number of whole seconds. This must be an integer in the range 0 to 59.
f
The fractional portion of the seconds. Precision beyond 5 decimal places is ignored.

The range of the new IfxTimeSpan is start to end. If start and end are not given the range is Day to Fraction5.

All time units in the range must be present in _szTime, even if they are zero. If format is provided then time units outside the range are optional. If they are present they are ignored. If format is not provided then time units outside the range are not allowed.

The format string uses the same syntax as the DBTIME environment variable except that it cannot contain placeholders for month or year. For the details about the syntax, refer to the description of the DBTIME environment variable in the HCL OneDB ESQL/C Programmer's Manual.

IfxTimeSpan.ToString

System.String IfxTimeSpan.ToString()
System.String IfxTimeSpan.ToString (System.String format)
Returns the value of the instance as a string. If format is not present the format used is:
D hh:mm:ss.f
D
The number of whole days in the value
hh
Two digit hour in range of 00 to 23
mm
Two digit minute
ss
Two digit second
f
The fractional portion of the seconds

Portions outside the range of the instance are not included in the string.

If format is provided the output is formatted in the way indicated in that string. The format string uses the same syntax as the DBTIME environment variable. For the details of the syntax, refer to the description of the DBTIME environment variable in the HCL OneDB Guide to SQL: Reference.