diff options
Diffstat (limited to 'src/backend/utils/adt/nabstime.c')
-rw-r--r-- | src/backend/utils/adt/nabstime.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backend/utils/adt/nabstime.c b/src/backend/utils/adt/nabstime.c index 95c1442ac31..b6147490be7 100644 --- a/src/backend/utils/adt/nabstime.c +++ b/src/backend/utils/adt/nabstime.c @@ -4,7 +4,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: nabstime.c,v 1.50 1998/12/15 15:28:57 scrappy Exp $ + * $Id: nabstime.c,v 1.51 1998/12/31 16:30:59 thomas Exp $ * */ #include <stdio.h> @@ -57,7 +57,7 @@ GetCurrentAbsoluteTime(void) if (!HasCTZSet) { #ifdef USE_POSIX_TIME -#ifdef HAVE_TM_ZONE +#if defined(HAVE_TM_ZONE) tm = localtime(&now); CTimeZone = -tm->tm_gmtoff; /* tm_gmtoff is Sun/DEC-ism */ @@ -86,9 +86,8 @@ GetCurrentAbsoluteTime(void) CTimeZone = tb.timezone * 60; CDayLight = (tb.dstflag != 0); - /* - * XXX does this work to get the local timezone string in V7? - - * tgl 97/03/18 + /* XXX does this work to get the local timezone string in V7? + * - tgl 97/03/18 */ strftime(CTZName, MAXTZLEN, "%Z", localtime(&now)); #endif @@ -136,14 +135,14 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn) #endif #if defined(DATEDEBUG) -#if (! defined(HAVE_TM_ZONE)) && defined(HAVE_INT_TIMEZONE) - printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s %s dst=%d\n", - tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, tx->tm_sec, - tzname[0], tzname[1], tx->tm_isdst); -#else +#if defined(HAVE_TM_ZONE) printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s dst=%d\n", tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, tx->tm_sec, tx->tm_zone, tx->tm_isdst); +#elif defined(HAVE_INT_TIMEZONE) + printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s %s dst=%d\n", + tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, tx->tm_sec, + tzname[0], tzname[1], tx->tm_isdst); #endif #endif @@ -157,7 +156,7 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn) tm->tm_sec = tx->tm_sec; tm->tm_isdst = tx->tm_isdst; -#ifdef HAVE_TM_ZONE +#if defined(HAVE_TM_ZONE) tm->tm_gmtoff = tx->tm_gmtoff; tm->tm_zone = tx->tm_zone; @@ -171,7 +170,7 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn) *tzp = (tm->tm_isdst ? (timezone - 3600) : timezone); if (tzn != NULL) strcpy(tzn, tzname[tm->tm_isdst]); -#else /* !HAVE_INT_TIMEZONE */ +#else #error POSIX time support is broken #endif #else /* ! USE_POSIX_TIME */ |