IfxMonthSpan public methods

IfxMonthSpan.Add

IfxMonthSpan IfxMonthSpan.Add(IfxMonthSpan ms)

Returns a new IfxMonthSpan set to the value of the this instance plus the amount of time in ms.

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

IfxMonthSpan.Compare

static System.Int32 IfxMonthSpan.Compare(IfxMonthSpan ms1, IfxMonthSpan ms2)

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 years is less than a span of 2 months.

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

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

IfxMonthSpan.CompareTo

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

The object obj must be an IfxMonthSpan.

This is equivalent to calling IfxMonthSpan.Compare with this instance as ms1 and obj as ms2.

IfxMonthSpan.Divide

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

IfxMonthSpan.Duration

IfxMonthSpan IfxMonthSpan.Duration()

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

IfxMonthSpan.Equals

static Boolean IfxMonthSpan.Equals(IfxMonthSpan ms1, IfxMonthSpan ms2)
Returns true if ms1 and ms2 have the same value; otherwise returns false.
Boolean IfxMonthSpan.Equals(System.Object obj)
Returns true if obj is an IfxMonthSpan that represents the same time offset as this instance; otherwise it returns false.

IfxMonthSpan.GetHashCode

System.Int32 IfxMonthSpan.GetHashCode()

Returns the hash code for this instance.

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

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

IfxMonthSpan.GreaterThan

static System.Boolean IfxMonthSpan.GreaterThan(IfxMonthSpan ms1, IfxMonthSpan ms2
)

Returns true if IfxMonthSpan.Compare(ms1, ms2) would return 1; otherwise, it returns false.

IfxMonthSpan.GreaterThanOrEqual

static System.Boolean IfxMonthSpan.GreaterThanOrEqual(IfxMonthSpan ms1, IfxMonthSpan 
ms2)

Returns true if IfxMonthSpan.Compare(ms1, ms2) would return either 1 or 0; otherwise, it is false.

IfxMonthSpan.LessThan

System.Boolean IfxMonthSpan.LessThan(IfxMonthSpan ms1, IfxMonthSpan ms2)

Returns true if IfxMonthSpan.Compare(ms1, ms2) would return -1; otherwise, it returns false.

IfxMonthSpan.LessThanOrEqual

System.Boolean IfxMonthSpan.LessThanOrEqual(IfxMonthSpan ms1, IfxMonthSpan ms2)

Returns true if IfxMonthSpan.Compare(ms1, ms2) would return -1 or 0; otherwise, it returns false.

IfxMonthSpan.Multiply

IfxMonthSpan IfxMonthSpan.Multiply(Decimal val)

Returns a new IfxMonthSpan set to the value of this instance multiplied by val.

IfxMonthSpan.Negate

IfxMonthSpan IfxMonthSpan.Negate()

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

IfxMonthSpan.NotEquals

static System.Boolean IfxMonthSpan.NotEquals(IfxMonthSpan ms1, IfxMonthSpan ms2
)

Returns true if IfxMonthSpan.Compare(ms1, ms2) would return -1 or 1; otherwise, it returns false.

IfxMonthSpan.Parse

static IfxTimeSpan IfxMonthSpan.Parse(System.String val)
static IfxTimeSpan IfxMonthSpan.Parse(System.String val, IfxTimeUnit start, 
IfxTimeUnit end)
static IfxTimeSpan IfxMonthSpan.Parse(System.String val, System.String format,
IfxTimeUnit start, IfxTimeUnit end)
Returns a new IfxMonthSpan with a value based on val. If format is not given, the val string must be in this format:
[s]y- m
s
Optional sign. If present this can be either + or -. The default is +. The brackets ([]) are not part of the time span. They indicate that the sign is optional.
y
The number of whole years in the span. This must be an integer in the range 0 to 999 999 999.
m
The number of months. This must be an integer in the range 0 to 11.

The range of the new IfxMonthSpan is start to end. Only Year and Month are allowed in an IfxMonthSpan. If start and end are not given, the range is Year to Month. Values each unit in the range must be present in val, even if one or both are zero. Values outside the range must not be present. If only one time unit is used then the - is not used.

The format string uses the same syntax as the DBTIME environment variable except that the only placeholders it can include are %Y and %m. The %Y placeholder in this context accepts the number of years in a range from 0 to 999 999 999. All units for which there are placeholders must be present . For the details of the syntax, refer to the description of the DBTIME environment variable in the HCL OneDB Guide to SQL: Reference.

If both year and month are given in val and accepted in format, then they are both used even if the range is year to year or month to month. If a IfxMonthSpan has a range of year to year and its value includes a total number of months that is not evenly divisible by 12 the extra months are ignored.

Example: The string output by this command is 1.
IfxMonthSpan.Parse("1-11","%Y-%m",
System.Double.Year,System.Double.Year).ToString()

If the range of an IfxMonthSpan is month to month and both years and months are given in val and accepted by format then the years are converted to months.

Example: The string output by this command is 23.
IfxMonthSpan.Parse("1-11","%Y-%m",
System.Double.Month,System.Double.Month).ToString()

IfxMonthSpan.Subtract

IfxMonthSpan IfxMonthSpan.Subtract(IfxMonthSpan ms)

Returns a new IfxMonthSpan set to the value of this instance minus the value of ms.

IfxMonthSpan.ToString

System.String IfxMonthSpan.ToString()
System.String IfxMonthSpan.ToString (System.String format)
Returns the value of the instance as a string. If format is not present the format used is:
sy-m
s
Optional sign. A minus sign is shown here if the IfxMonthSpan is negative. Nothing is shown for positive values.
y
The number of whole years in the value
m
The number of months left over after calculating y

If the IfxMonthSpan has only one time unit then only that time unit is output and the dash that goes between the year and month is omitted.

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 except that only the %m, %y and %Y placeholders are allowed. The %y and %Y placeholders work the same way in this string. For the details of the syntax, refer to the description of the DBTIME environment variable in the HCL OneDB Guide to SQL: Reference.