The mi_datetime_to_string() function
The mi_datetime_to_string() function creates an ANSI SQL standard text (string) representation of a date, time, or date and time value from the binary (internal) DATETIME representation.
Syntax
mi_string *mi_datetime_to_string(dt_data)
mi_datetime *dt_data;
- dt_data
- A pointer to the internal DATETIME representation of the date, time, or date and time value.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
"YYYY-MM-DD HH:mm:SS.FFFFF"
- YYYY
- The 4-digit year.
- MM
- The 2-digit month.
- DD
- The 2-digit day.
- HH
- The 2-digit hour.
- mm
- The 2-digit minute.
- SS
- The 2-digit second.
- FFFFF
- The fraction of a second, in which the date, time, or date and time qualifier specifies the number of digits, with a maximum precision of 5 digits.
"2007-01-31 10:30"
For GLS, the mi_datetime_to_string() function does not format the date, time, or date and time string in the date and time formats of the current processing locale.
For more information about how to convert internal DATETIME values to date, time, or date and time strings, see the HCL OneDB™ DataBlade API Programmer's Guide.
Return values
- An mi_string pointer
- A pointer to the date, time, or date and time string equivalent of dt_data.
- NULL
- The function was not successful.