Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* KMail time
@ 1998-10-18 17:09 Stefan Katzenbeisser
  1998-10-18 18:21 ` Michal Jaegermann
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Katzenbeisser @ 1998-10-18 17:09 UTC (permalink / raw)
  To: axp-list

I just investigated the kMail time problem (sometimes it prints 48409
as the current year). This seems to be some strange gmtime() problem. 
kMail executes the routine _FromUnixTime from the MIMELIB (datetime.cpp)
twice when it starts up  (don't ask me why...)

void DwDateTime::_FromUnixTime(DwUint32 aTime)
{

printf("Executing _FromUnixTime with %d\n", aTime);

    DwUint32 t = aTime + mZone*60;
#if defined(USE_PORTABLE_GMTIME)
    struct tm tt;
    my_gmtime_r(&t, &tt);
#elif defined(HAVE_GMTIME_R)
    struct tm tt;
    gmtime_r(&t, &tt);
#else

printf("gmtime called with %d\n", t);

      struct tm tt = *gmtime((time_t*)&t);
#endif
    mYear   = tt.tm_year + 1900;
    mMonth  = tt.tm_mon + 1;
    mDay    = tt.tm_mday;
    mHour   = tt.tm_hour;
    mMinute = tt.tm_min;
    mSecond = tt.tm_sec;

    printf("Result: %d\n", mYear);
}

This is the output when kMail starts up: 

Executing _FromUnixTime with 908730326
gmtime called with 908737526
Result: 1998
Executing _FromUnixTime with 908730326
gmtime called with 908737526
Result: 48409  

gmtime() gives two *different* results????

In order to avoid that problem, recompile MIMELIB with the
-DUSE_PORTABLE_GMTIME option and recompile KDE. kMail works fine 
then.

Best,
S.K. 
--
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
| Stefan Katzenbeisser
| e-mail: skatzenbeisser@acm.org
| http://stud3.tuwien.ac.at/~e9625414/
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Public PGP key available on my homepage or upon request.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1998-10-18 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-10-18 17:09 KMail time Stefan Katzenbeisser
1998-10-18 18:21 ` Michal Jaegermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox