Hello Riley, hello all,

>  >> At login, FBB showed a date of 01.01.190 (yes, that's no typo!).
>  >> Although we were estonished we stopped further investigating this
>  >> problem since we didn't want to corrupt our mail database.
> 
>  > Are you sure that it is 190 ? Not 100 ? The latter would be easy
>  > to explain with "struct tm". It has a member tm_year that is
>  > often mistakingly taken as representing the year and decade as a
>  > two digit number when it actually is years since 1900 (see man
>  > mktime). The fix would be to get two digits with (tm.tm_year %
>  > 100) or better the correct year with (tm.tm_year + 1900).
> 
> That 190 is almost certainly correct - I would imagine the relevant
> code looks something like the following:
> 
>  Q> printf( "%02u.%02u.19%u", tm_mday, tm_mon, tm_year % 100 );
> 
> Try it, and you'll see you get just that for a date of 1st Jan 2000,
> and the fix would be to use the following instead:
> 
>  Q> printf( "%02u.%02u.%u", tm_mday, tm_mon, tm_year + 1900 );

Thank you very much, Tomi and Riley, for this discussion, and to 
you, Riley, once again especially for presenting the first attempt to 
fix this problem.

My question was readable to the lists two days ago, and here's the 
first bugfix. That's the thing one can IMHO only experience in the 
Linux community. So, I'll stick to Linux and will continue migrating 
to this OS despite the newly-born Windows trend :)

Cheers, 73

Gerd

Reply via email to