IfxDateTime public methods

IfxDateTime.Add

IfxDateTime IfxDateTime.Add(IfxTimeSpan ifxTS)
IfxDateTime IfxDateTime.Add(IfxMonthSpan ifxMS)

Returns a new IfxDateTime set to the value of the instance plus the amount of time represented by ifxTS or ifxMS. The new IfxDateTime has the same range as the instance. The instance itself is not changed.

Adding an IfxMonthSpan is not the same as adding a well defined span of time because there are a varying number of days in a month. When you add an IfxMonthSpan the addition is performed only on the year and month portions of the IfxDateTime. All other time units will be the same as they are in the instance.

IfxDateTime.AddDays

IfxDateTime IfxDateTime.AddDays(System.Double days)

Returns a new IfxDateTime set to the same value as this instance plus the number of days in days. The value of days can be negative. Fractional values are permitted. The instance itself is not changed.

The new IfxDateTime has the same range as the instance. If the resulting date will not fit in that range an error is given.

IfxDateTime.AddMilliseconds

IfxDateTime IfxDateTime.AddMilliseconds(System.Double milliseconds)

Returns a new IfxDateTime set to the same value as this instance plus the number of milliseconds in milliseconds. The value of milliseconds can be negative. It must be greater than -1 000 000 000 and less than 1 000 000 000. Fractional values are permitted. The instance itself is not changed.

The new IfxDateTime has the same range as the instance. If the resulting date will not fit in that range an error is given.

IfxDateTime.AddMinutes

IfxDateTime IfxDateTime.AddMinutes(System.Double minutes)

Returns a new IfxDateTime set to the same value as this instance plus the number of minutes in minutes. The value of minutes can be negative. It must be greater than -1 000 000 000 and less than 1 000 000 000. Fractional values are permitted.

The new IfxDateTime has the same range as the instance. The instance itself is not changed. If the resulting date will not fit in that range an error is given.

IfxDateTime.AddMonths

IfxDateTime IfxDateTime.AddMonths(System.Double months)

Returns a new IfxDateTime set to the same value as this instance except that the months portion has the value of months added to it. The value of months can be negative. The instance itself is not changed.

This is not the same as adding a well-defined span of time because the length of a month varies. Units smaller than month will never be affected by the addition.

The new IfxDateTime has the same range as the instance. If the resulting date will not fit in that range an error is given. You will also get an error if the resulting date is invalid, such as February 31.

IfxDateTime.AddSeconds

IfxDateTime IfxDateTime.AddSeconds(System.Double seconds)

Returns a new IfxDateTime set to the same value as this instance plus the number of seconds in seconds. The value of seconds can be negative. It must be greater than -1 000 000 and less than 1 000 000 000. Fractional values are permitted. The instance itself is not changed.

The new IfxDateTime has the same range as the instance. If the resulting date will not fit in that range an error is given.

IfxDateTime.AddYears

IfxDateTime IfxDateTime.AddYears(System.Int32 years)

Returns a new IfxDateTime set to the same value as this instance except that the years portion has the value of years added to it. The value of years can be negative. The instance itself is not changed.

This is not the same as adding a well-defined span of time because the length of a year varies. Units smaller than year will never be affected by the addition.

The new IfxDateTime has the same range as the instance. If the resulting date will not fit in that range an error is given. You will also get an error if the resulting date is February 29 on a non-leap year.

IfxDateTime.Compare

static IfxDateTime IfxDateTime.Compare(IfxDateTime ifxDT1, IfxDateTime ifxDT1)
Returns a value based on the relative values of ifxDT1 and ifxDT2:
-1
ifxDT1 is earlier than ifxDT2
0
ifxDT1 and ifxDT2 are the same time
1
ifxDT1 is later than ifxDT2

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.

Any two IfxDateTime objects can be compared. Default values are used for any time units that are not in the range of the IfxDateTime. See Default values for time units in IfxDateTime objects for the default values that are used.

IfxDateTime.CompareTo

System.Int32 IfxDateTime.CompareTo(System.Object obj)

The object obj must be an IfxDateTime.

This is equivalent to calling IfxDateTime.Compare with this instance as ifxDT1 and obj as ifxDT2.

IfxDateTime.DaysInMonth

static System.Int32 IfxDateTime.DaysInMonth(System.Int32 year, System.Int32 month
)

Returns the number of days in the month of the year.

IfxDateTime.Equals

static System.Boolean IfxDateTime.Equals(IfxDateTime ifxDT1, IfxDateTime ifxDT2
)

This method returns true if IfxDateTime.Compare(ifxDT1, ifxDT2) would return 0. If not it returns false.

IfxDateTime.GetHashCode

System.Int32 IfxDateTime.GetHashCode()

Returns the hash code for this instance.

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

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

IfxDateTime.GreaterThan

static System.Boolean IfxDateTime.GreaterThan(IfxDateTime ifxDT1, IfxDateTime 
ifxDT2)

This method returns true if IfxDateTime.Compare(ifxDT1, ifxDT2) would return 1. If not it returns false.

IfxDateTime.GreaterThanOrEqual

static System.Boolean IfxDateTime.GreaterThanOrEqual(IfxDateTime ifxDT1, IfxDateTime 
ifxDT2)

This method returns true if IfxDateTime.Compare(ifxDT1, ifxDT2) would return 0 or 1. If not, it returns false.

IfxDateTime.LessThan

static System.Boolean IfxDateTime.LessThan(IfxDateTime ifxDT1, IfxDateTime 
ifxDT2)

This method returns true if IfxDateTime.Compare( ifxDT1, ifxDT2 ) would return -1. If not it returns false.

IfxDateTime.LessThanOrEqual

static System.Boolean IfxDateTime.LessThanOrEqual(IfxDateTime ifxDT1, IfxDateTime 
ifxDT2)

This method returns true if IfxDateTime.Compare(ifxDT1, ifxDT2) would return 0 or -1. If not it returns false.

IfxDateTime.NotEquals

static System.Boolean IfxDateTime.NotEquals(IfxDateTime ifxDT1, IfxDateTime 
ifxDT2)

This method returns true if IfxDateTime.Compare(ifxDT1, ifxDT2) would return 1 or -1. If not it returns false.

IfxDateTime.Parse

static IfxDateTime IfxDateTime.Parse(System.String dateTimeString)
static IfxDateTime IfxDateTime.Parse(System.String dateTimeString, IfxTimeUnit 
start, IfxTimeUnit end)
static IfxDateTime IfxDateTime.Parse(System.String dateTimeString, System.String 
format, IfxTimeUnit start, IfxTimeUnit end)
Returns a new IfxDateTime with a value based on dateTimeString. If format is not given, the dateTimeString string must be in this format:
Y-M-DD hh:mm:ss.f
Y
An integer indicating the year.
M
The number of the month in the range 1 to 12.
D
The number of day in the month.
h
The hour of the day in the range 0 to 23.
m
The minute of the hour in the range 0 to 59.
s
The second of the minute 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 IfxDateTime 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 dateTimeString, 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. For the details about the syntax, refer to the description of the DBTIME environment variable in the HCL OneDB Guide to SQL: Reference.

IfxDateTime.ToString

System.String IfxDateTime.ToString()
System.String IfxDateTime.ToString (System.String format)
Returns the value of the instance as a string. If format is not present the format used is:
YYYY-MM-DD hh:mm:ss.f
YYYY
Four digit year
MM
Two digit month
DD
Two digit day
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.