Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* localtime() function on DEC Alpha OSF/1
@ 1993-08-13 19:40 Richard Eckman
  1993-08-14  2:11 ` Mike Iglesias
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Eckman @ 1993-08-13 19:40 UTC (permalink / raw)


  Is there a problem with the localtime() function under OSF/1 on the DEC
Alpha systems?  Using the program below, I can't seem to get anything
by garbage for the tm_gmtoff (offset in seconds from the Greenwich meridian)
value.

-----------------------------
#include <stdio.h>
#include <sys/time.h>
#include <time.h>

main()
{
	time_t t;
	struct tm *tm;

#ifdef DO_TZSET
	tzset();
#endif
	(void) time(&t);
	tm = localtime(&t);
	printf("tm->tm_gmtoff = %ld\n", (long)tm->tm_gmtoff/60);
	printf("tm->tm_zone = %s\n", tm->tm_zone);
	exit(0);
}
------------------------------
Result:

tm->tm_gmtoff = 71582548
tm->tm_zone = EDT

  Any suggestions would be appreciated.

Richard Eckman
NASA Langley
eckman@eos1.larc.nasa.gov


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

* Re: localtime() function on DEC Alpha OSF/1
  1993-08-13 19:40 localtime() function on DEC Alpha OSF/1 Richard Eckman
@ 1993-08-14  2:11 ` Mike Iglesias
  1993-08-14  8:25   ` Burkhard Neidecker-Lutz
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Iglesias @ 1993-08-14  2:11 UTC (permalink / raw)


In article <24gqmpINNe5r@rave.larc.nasa.gov>,
Richard Eckman <eckman@eos1.larc.nasa.gov> wrote:
>  Is there a problem with the localtime() function under OSF/1 on the DEC
>Alpha systems?  Using the program below, I can't seem to get anything
>by garbage for the tm_gmtoff (offset in seconds from the Greenwich meridian)
>value.

Yes, there's a bug.  Change this line in your program:

	printf("tm->tm_gmtoff = %ld\n", (long)tm->tm_gmtoff/60);

to this:

	printf("tm->tm_gmtoff = %ld\n", (int)tm->tm_gmtoff/60);

I found this a while back; I think DEC said it would be fixed in OSF v1.3,
but I'm not sure.  The problem is that the upper 32 bits of the long are
not setup properly so you get garbage.

-- 
Mike Iglesias                        Internet:    iglesias@draco.acs.uci.edu
University of California, Irvine     BITNET:      iglesias@uci
Office of Academic Computing         uucp:        ...!ucbvax!ucivax!iglesias
Distributed Computing Support        phone:       (714) 856-6926


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

* Re: localtime() function on DEC Alpha OSF/1
  1993-08-14  2:11 ` Mike Iglesias
@ 1993-08-14  8:25   ` Burkhard Neidecker-Lutz
  0 siblings, 0 replies; 3+ messages in thread
From: Burkhard Neidecker-Lutz @ 1993-08-14  8:25 UTC (permalink / raw)


In article <2C6C49B6.28355@news.service.uci.edu> iglesias@draco.acs.uci.edu (Mike Iglesias) writes:
>I found this a while back; I think DEC said it would be fixed in OSF v1.3,
>but I'm not sure. 

It's fixed:

% cat /etc/motd
DEC OSF/1 V1.3 (Rev. 111); Wed Jul 28 11:21:08 MET DST 1993 

% cc   time.c  -o time
% ./time
tm->tm_gmtoff = 120
tm->tm_zone = MET DST


		Burkhard Neidecker-Lutz

Distributed Multimedia Group, CEC Karlsruhe  
Software Motion Pictures & BERKOM II Project
Digital Equipment Corporation
neidecker@nestvx.enet.dec.com




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

end of thread, other threads:[~1993-08-14  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-08-13 19:40 localtime() function on DEC Alpha OSF/1 Richard Eckman
1993-08-14  2:11 ` Mike Iglesias
1993-08-14  8:25   ` Burkhard Neidecker-Lutz

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