#include <ifxgls.h> int ifx_gl_format_datetime(char *datetimestr, int datetimebytes, mi_datetime *datetime, char *format)
If format is NULL, then the format is determined from the environment as follows:
If format is not NULL, then it must point to a string which follows the rules described in the FORMAT section below.
If a conversion specification does not correspond to any of the above, the behaviour is undefined.
An optional justification, field width and precision specification can immediately follow the initial % of a directive according to the following: [-|0][<width>][.<precision>]
For the C, d, e, Ey, F, H, iF, iy, iY, I, j, m, M, S, u, w, y and Y directives, the value of <precision> specifies the minimum number of digits to appear. If a directive supplies fewer digits than specified by the precision, it will be padded with leading zeros.
For the a, A, b, B, EC, Eg, h, and p directives, the value of <precision> specifies the maximum number of characters to be used. If a value to be formatted has more characters than specified by the precision, the result will be truncated on the right.
The values of <width> and <precision> do not affect the c, Ec, Ex, EX, EY, r, n, t, x, X or %.
The values of <width> and <precision> affect each element of the D, R, and T directives. For example %6.4D would be printed as "%6.4m/%6.4d/%6.4y".
The F and iF directives may be followed by an optional precision specification. For example, "%F3" means precision of 3. The value of this precision must be between 1 and 5. If it is not between 1 and 5, then an error is returned. This specification overrides the precision value between the % and the directive if it is given.
For the directives modified with O (Alternate Digits) the field width and relates to display width rather than actual number of digits. The precision is still the minimum number of digits printed.
The d, Ey, H, iF, iy, I, m, M, S, u, w, and y directives have a default precision of .2.
The j directive has a default precision of 3.
The Y and iY directives have a default precision of 4.
The F directive has a default precision of 6.