* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)timezone.c 5.2 (Berkeley) 3/9/86";
#endif LIBC_SCCS and not lint
* The arguments are the number of minutes of time
* you are westward from Greenwich and whether DST is in effect.
* giving the name of the local timezone.
* Sorry, I don't know all the names.
-1*60, "MET", "MET DST", /* Middle European */
-2*60, "EET", "EET DST", /* Eastern European */
4*60, "AST", "ADT", /* Atlantic */
5*60, "EST", "EDT", /* Eastern */
6*60, "CST", "CDT", /* Central */
7*60, "MST", "MDT", /* Mountain */
8*60, "PST", "PDT", /* Pacific */
/* there's no way to distinguish this from WET */
0, "GMT", 0, /* Greenwich */
0*60, "WET", "WET DST", /* Western European */
-10*60, "EST", "EST", /* Aust: Eastern */
-10*60+30, "CST", "CST", /* Aust: Central */
-8*60, "WST", 0, /* Aust: Western */
char *timezone(zone
, dst
)
register struct zone
*zp
;
char *getenv(), *index();
if (p
= getenv("TZNAME")) {
strncpy(czone
, p
, sizeof(czone
)-1);
czone
[sizeof(czone
)-1] = '\0';
for (zp
=zonetab
; zp
->offset
!=-1; zp
++)
sprintf(czone
, "GMT%s%d:%02d", sign
, zone
/60, zone
%60);