locale, returns two digit year
Asked by
Theodore M Rolle, Jr.
I downloaded alarm-clock-
./configure completes successfully.
make fails with the message:
util.c: In function ‘get_alarm_
util.c:57:31: error: ‘%c’ yields only last 2 digits of year in some locales [-Werror=
strftime (tmp, sizeof (tmp), "%c", tm);
So?
Fix it programatically instead of diagnosing the problem and giving up.
if (year < 100) {
year += 2000;
} else {
// Leave 4-digit year alone.
}
--- OR ----
year = (year < 100) ? year+2000 : year;
Question information
- Language:
- English Edit question
- Status:
- Expired
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
To post a message you must log in.