GNOME Bugzilla – Bug 306945
Two Digit Years Are Converted Unconditionally to 20XX
Last modified: 2008-03-14 17:14:30 UTC
Distribution: Red Hat Enterprise Linux AS release 4 (Nahant Update 1) Package: Evolution Severity: normal Version: GNOME2.8.0 unspecified Gnome-Distributor: Red Hat, Inc Synopsis: Two Digit Years Are Converted Unconditionally to 20XX Bugzilla-Product: Evolution Bugzilla-Component: Contacts [was: Addressbook] Bugzilla-Version: unspecified Description: Description of Problem: If you enter a date like "1/1/77" into the birthday field is converted to 1/1/2077. There should be some pivot point (e.g., now), for this date input so that two digit years go backwards if they are greater than the current year. For other boxes, some logical default like 10 years into the future could be used. ------- Bug moved to this database by unknown@bugzilla.gnome.org 2005-06-08 20:24 UTC -------
correct, confirming. it's the same in the appointment editor, by the way (but perhaps it makes sense to only set appointments in the future ;-)
The string to date/time conversion happens in evolution/e-util/e-time-utils.[ch] ETimeParseStatus e_time_parse_date (const char *value, struct tm *result) This file uses the current century if only 2 digits have been used. Quite a reasonable decision if it's used both for birthdays as well as appointments. Maybe a parameter could be introduced to seperate for future or past. An int to specify the offset might be possible as well. I'll see where this funktion is being used and then i might write a patch...
*** Bug 339813 has been marked as a duplicate of this bug. ***
There are a couple of possible solutions to this. I notice that locales with four-digit years don't have this problem. An attractive solution would be to force four-digit years for all locales. No idea if that's possible to do, though. A likely more feasible solution is to add an extra flag for dates in the past to e_time_parse_date as Max sketches. The add century conditional could be skipped then. Suboptimal and will break abi, but in my opinion, the most feasible.
*** Bug 491842 has been marked as a duplicate of this bug. ***
Oystein, what about a separate function which adds this sort of pivot point to e_time_parse_date? That way you at least wouldn't break abi...
This has been fixed there already. *** This bug has been marked as a duplicate of 339813 ***