Subject: Re: strftime(%Z)
To: Johan Danielsson <>
From: Todd Vierling <tv@NetBSD.ORG>
List: tech-userlevel
Date: 03/21/1998 09:59:46
On 21 Mar 1998, Johan Danielsson wrote:

: What should the following program output (given that your `normal'
: timezone isn't GMT):

:     strftime(buf, sizeof(buf), "%Z", gmtime(&t));

: I think it should output `GMT', but it does output my local
: timezone. This seems to be consistent with most other systems I've
: tried, but I consider it a bug. Is this supposed to be bug compatible
: with something?

This is how the function is described in a couple standards.

If you really want it to display GMT for this, the procedure is simple:
putenv("TZ=GMT").  Actually, putenv("TZ=UTC") would be better.  :>

-- Todd Vierling (Personal; Bus.