Date binary representation

The SQL DATE data type holds the internal (binary) format of a decimal value. This value is an integer value that represents the number of days since December 31, 1899. Dates before December 31, 1899, are negative numbers, while dates after December 31, 1899, are positive numbers.

Tip: The internal format of the DATE data type is often referred to as its binary representation.

The DataBlade® API supports the SQL DATE data type with the mi_date data type. Therefore, the mi_date data type also holds the binary representation of a date value.

The mi_date data type is guaranteed to be four bytes on all computer architectures. All mi_date values can fit into an MI_DATUM structure and can be passed by value within C UDRs.

All data types, including mi_date, must be passed by reference within client LIBMI applications.

Because the binary representation of a DATE (and mi_date) value is a proprietary format, you cannot use standard system functions to obtain date information from mi_date values. Instead, the DataBlade API provides the following support for the DATE data type.
  • Conversion functions
  • Operation functions