mktime() question

From: Shiva Gowda (sgowda@orga.com)
Date: Tue Jul 23 2002 - 05:17:43 EDT


Hi Gurus,

Recently we migrated one of our application from 4.0F to 5.1A.
 From then onwards we have some problems with the application.
That is because of mktime() library function. The values returned
by this function is not the same. Is there any change in the
functionality of mktime()?

The timezones are different on both the systems. One is in DST &
the other in CEST. Both are UTC+02. Does it affect the mktime() function?

thx,

//Shiva

Here is an example:

sgowda@od-dec-unix-7<113> cat time.c
#include <stdio.h>
#include <time.h>

main() {
         struct tm t;
         sscanf("19990716112330", "%04d%02d%02d%02d%02d%02d",
                 &(t.tm_year), &(t.tm_mon), &(t.tm_mday), &(t.tm_hour), &(t.tm_min), &(t.tm_sec));
         t.tm_year -= 1900;
         t.tm_mon--;
         printf("time in time_t: %d\n", mktime(&t));
}

sgowda@od-dec-unix-7<107> sizer -v
Digital UNIX V4.0F (Rev. 1229); Sun Jan 13 16:29:23 MET 2002
sgowda@od-dec-unix-7<108> ./time
time in time_t: 932120610 #<<<<<< Note the value
sgowda@od-dec-unix-7<109>

sgowda@ds10l-51A<83> sizer -v
Compaq Tru64 UNIX V5.1A (Rev. 1885); Tue Feb 5 13:03:20 CET 2002
sgowda@ds10l-51A<84> ~/time
time in time_t: 932117010 #<<<<< Its different from above output.
sgowda@ds10l-51A<85>



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:48:46 EDT