IfxDateTime structure

An IfxDateTime represents a single moment in the span of time from midnight on 1 January 0001 to 11:59:59.99999 pm. on 31 December 9999.

An IfxDateTime is treated as if it were made up of a separate value for each of these time units:
  • Year
  • Month
  • Day
  • Hour
  • Minute
  • Second
  • Fractions of a second

You can create an IfxDateTime that uses only a subset of these time units. This is allowed in order to mimic the behavior of the database server's DATETIME data type. It does not save any space in memory when you use fewer time units in an IfxDateTime.

The largest time unit of an IfxDateTime is called the start time unit. The smallest time unit of an IfxDateTime is called the end time unit. The start time unit, the end time unit, and all time units in between are called the range of the IfxDateTime.

Example: If an IfxDateTime uses the year, month, and day portions then the start time unit is year, the end time unit is day, and the range is year to day.

Time units that are not included in the range of the IfxDateTime are assumed to have a default value as listed in this table.

Table 1. Default values for time units in IfxDateTime objects
Time unit Default value
Year 1200
Month 1
Day 1
Hour 0
Minute 0
Second 0
Fraction 0

When creating an IfxDateTime you specify time units using the members of the IfxTimeUnit enumeration. For details about this enumeration see IfxTimeUnit enumeration.