From: Stefan Katzenbeisser <e9625414@student.tuwien.ac.at>
To: axp-list@redhat.com
Subject: KMail time
Date: Sun, 18 Oct 1998 19:09:46 +0200 [thread overview]
Message-ID: <98101819421300.11586@dolph> (raw)
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.
next reply other threads:[~1998-10-18 17:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-10-18 17:09 Stefan Katzenbeisser [this message]
1998-10-18 18:21 ` KMail time Michal Jaegermann
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox