To convert a date that is in the native database date format to a string
mint rdatestr(int4 jdate, char *str);
0 The
conversion was successful.
<0 The conversion failed.
-1210 The internal date could not be converted to the
character string format.
-1212 Data conversion format must contain a month, day,
or year component.
DBDATE specifies the data conversion format.
Returns the day of the week of a date that is in the native database format
mint rdayofweek(int4 jdate);
0 Sunday
1 Monday
2 Tuesday
3 Wednesday
4 Thursday
5 Friday
6 Saturday
To convert a string in a specified format to the native database date format
mint rdefmtdate(int4 *pdate, char *fmtstring, char *input);
0 The operation was
successful.
-1204 The input parameter specifies an invalid year.
-1205 The input parameter specifies an invalid month.
-1206 The input parameter specifies an invalid day.
-1209 Because input does not contain delimiters between the
year,month,and day, the length of input must be exactly six or eight
bytes.
-1212 fmtstring does not specify a year, a month, and a day.
To convert a date that is in the native database date format to a string having a specified format
mint rfmtdate(int4 jdate, char *fmtstring, char *result);
0 The conversion was
successful.
-1210 The internal date cannot be converted to month-day-year format.
-1211 The program ran out of memory (memory-allocation error).
-1212 Format string is NULL or invalid.
To create an array of short integer values representing year, month, and day from a date that is in the native database date format
mint rjulmdy(int4 jdate, int2 mdy[3]);
0 The operation was
successful.
< 0 The operation failed.
-1210 The internal date could not be converted to the character string format.
To determine whether the value passed as a parameter is a leap year; returns 1 when TRUE.
mint rleapyear(mint year);
1 The year is a leap year.
0 The year is not a leap year.
To create a value in the native database date format from an array of short integer values representing month, day, and year
mint rmdyjul(int2 mdy[3], int4 *jdate);
0 The operation was
successful.
-1204 The mdy[2] variable contains an invalid year.
-1205 The mdy[0] variable contains an invalid month.
-1206 The mdy[1] variable contains an invalid day.
To convert a character string to the native database date format.
mint rstrdate(char *str, int4 *jdate);
0 The conversion was successful.
< 0 The conversion failed.
-1204 The str parameter specifies an invalid year.
-1205 The str parameter specifies an invalid month.
-1206 The str parameter specifies an invalid day.
-1212 Data conversion format must contain a month, day, or year component.
DBDATE specifies the data conversion format.
-1218 The date specified by the str argument does not properly represent a
date.
Returns the system date in the internal database date format
void rtoday(int4 *today);
To convert a string in a specified format to the native database date format; allows you to specify the century setting for two-digit dates.
mint ifx_defmtdate(int4 *pdate, char *fmtstring, char *input,
char db_century);
Character Description R Present. The function uses the present century to expand the year value. P
Past. The function uses the present and past centuries to expand the year value. It compares these two dates against the current date and uses the century that is prior to the current century. If both dates are prior to the current date, the function uses the century closest to the current date. F
Future. The function uses the present and next centuries to expand the year value. It compares these against the current date and uses the century that is later than the current date. If both dates are later than the current date, the function uses the date closest to the current date. C
Closest. The function uses the present, past, and next centuries to expand the year value. It chooses the century that is closest to the current date.
To convert a character string to the native database date format; allows you to specify the century setting for two-digit dates.
mint ifx_strdate(char *str, int4 *jdate, char db_century);
Character Description R Present. The function uses pressent century to expand the year value. P
Past. The function uses the present and past centuries to expand the year value. It compares these two dates against the current date and uses the century that is prior to the current century. If both dates are prior to the current date, the function uses the century closest to the current date. F
Future. The function uses the present and next centuries to expand the year value. It compares these against the current date and uses the century that is later than the current date. If both dates are later than the current date, the function uses the date closest to the current date. C
Closest. The function uses the present, past, and next centuries to expand the year value. It chooses the century that is closest to the current date.
A date-formatting mask specifies a format to apply to some date value. This
mask is a combination of the following formats:
Character | Description |
dd | Day of the month as a two-digit number (01 through 31) |
ddd | Day of the week as a three-letter abbreviation (Sun through Sat) |
mm | Month as a two-digit number (01 through 12) |
mmm | Month as a three-letter abbreviation (Jan through Dec) |
yy | Year as a two-digit number (00 through 99) |
yyyy | Year as a four-digit number (0001 through 9999) |
ww | Day of the week as a two-digit number (00 for Sunday, 01 for Monday, 02 for Tuesday … 06 for Saturday) |
Any other characters in the formatting mask are reproduced literally in the
result.