Setting the Century for Date Formats with Two Digit Years ("YY")

If the date format string contains only two Ys, the system interprets the year as 19YY. You can change this default in your code using the set century break function, se_centurybreak():

void se_centurybreak(first_year)

int first_year;             /* First year in the century             */

where first_year is the first year in the 100-year time period used by your application. The century is set to extend 100 years from the specified first year and includes the current year. first_year must be an integer in the range 0–99.

For example, to allow users to enter dates in the range 1950–2050 in a date field with a format of DD/MM/YY, specify the following:

se_centurybreak(50);


Home Contents Previous Next