The mi_datetime_to_binary() function

The mi_datetime_to_binary() function converts a text (string) representation of a date, time, or date and time value to its binary (internal) DATETIME representation.

Syntax

mi_datetime *mi_datetime_to_binary(dt_string)
   mi_lvarchar *dt_string;
dt_string
A pointer to a date, time, or date and time string to convert to its internal DATETIME format.
Valid in client LIBMI application? Valid in user-defined routine?
Yes Yes

Usage

The mi_datetime_to_binary() function converts the date, time, or date and time string that dt_string references to its internal DATETIME value. An internal DATETIME value is the format that the database server uses to store a value in a DATETIME column of the database.

For GLS, the mi_datetime_to_binary() function accepts the date, time, or date and time string in the date and time format of the current processing locale. The function also performs any code-set conversion necessary between the current processing locale and the target locale.
Important: The mi_datetime_to_binary() function is supported only for compatibility with earlier versions of existing DataBlade® API modules. The DataBlade® API will eventually discontinue support for this function. Use the mi_string_to_datetime() function in any new DataBlade® API modules.

Return values

An mi_datetime pointer
A pointer to the internal DATETIME representation of dt_string.
NULL
The function was not successful.