From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Shiva Gowda Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: mktime() question Date: Wed, 24 Jul 2002 17:54:52 +0200 Organization: ORGA Kartensysteme GmbH Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3D3ECDCC.3010505@orga.com> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027626919 25245 127.0.0.1 (25 Jul 2002 19:55:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 25 Jul 2002 19:55:19 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17Xohh-0006Z4-00 for ; Thu, 25 Jul 2002 21:55:18 +0200 Original-Received: (qmail 28498 invoked by uid 5); 25 Jul 2002 19:35:33 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 28490 invoked from network); 25 Jul 2002 19:35:33 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (134.167.3.119) by 0 with SMTP; 25 Jul 2002 19:35:33 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GZT005TYL2TAS@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 25 Jul 2002 15:35:32 -0400 (EDT) Original-Received: from woodstock.orga-systems.de ([80.66.10.42]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTPS id <0GZT008JKL2H1K@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 25 Jul 2002 15:35:07 -0400 (EDT) Original-Received: from relay3.orga.com (root@[80.66.10.66]) by woodstock.orga-systems.de (8.11.6/8.11.6) with ESMTP id g6PJXiY18260 for ; Thu, 25 Jul 2002 21:33:44 +0200 (CEST) Original-Received: from relay1.orga.com (relay1.orga.com [194.122.136.34]) by relay3.orga.com (8.9.3/8.9.3) with ESMTP id VAA01962 for ; Thu, 25 Jul 2002 21:35:03 +0200 Original-Received: from relay3.orga.com (root@relay3.orga.com [192.168.134.42]) by relay1.orga.com (8.9.3/8.9.3) with ESMTP id RAA13843 for ; Wed, 24 Jul 2002 17:56:27 +0200 Original-Received: from pbcom1.orga.com (pbcom1.orga.com [192.168.134.72]) by relay3.orga.com (8.9.3/8.9.3) with ESMTP id RAA24957 for ; Wed, 24 Jul 2002 17:56:27 +0200 Original-Received: from orga.com ([192.168.132.97]) by pbcom1.orga.com (Lotus Domino Release 5.0.2c (Intl)) with ESMTP id 2002072417562721:8019 ; Wed, 24 Jul 2002 17:56:27 +0200 Original-To: tru64-unix-managers X-Accept-Language: en-us X-MIMETrack: Itemize by SMTP Server on PBCOM1/Paderborn/ORGA(Release 5.0.2c (Intl)|2 February 2000) at 07/24/2002 05:56:27 PM, Serialize by Router on PBCOM1/Paderborn/ORGA(Release 5.0.2c (Intl)|2 February 2000) at 07/24/2002 05:56:27 PM, Serialize complete at 07/24/2002 05:56:27 PM User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3 Xref: main.gmane.org gmane.os.tru64.managers:1106 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:1106 Thanks to Paul A. Sand, Bob Vickers, Oisin McGuinness Bob wrote: "mktime is supposed to give different results in different time zones. It converts local time to an internal Unix value which is always in UTC." Since both the system timzones are different I may get different values. But MET DST & CEST are UTC+02 I was expecting the same value. Oisin wrote: "..Your code fills in all of them, except for the tm_isdst field; presumably different initializations are being used on the two OS'es; ..You could check what the value appears to be before mktime is called to verify that there are differences in the initialization of tm_isdst." That's write, tm_isdst is being set to some +ve value in 4.0f and 0 in 5.1A. thx, Shiva -------- Original Message -------- 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 #include 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>