*** ../src/backend/utils/adt/dt.c.orig Thu Oct 8 18:30:07 1998 --- ../src/backend/utils/adt/dt.c Thu Dec 31 16:19:46 1998 *************** *** 1454,1464 **** tm->tm_year += 1900; tm->tm_mon += 1; ! #ifdef HAVE_INT_TIMEZONE ! tz = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone); ! ! #else /* !HAVE_INT_TIMEZONE */ tz = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ #endif #else /* !USE_POSIX_TIME */ --- 1454,1465 ---- tm->tm_year += 1900; tm->tm_mon += 1; ! #if defined(HAVE_TM_ZONE) tz = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ + #elif defined(HAVE_INT_TIMEZONE) + tz = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone); + #else + #error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined #endif #else /* !USE_POSIX_TIME */ *************** *** 2414,2429 **** #ifdef USE_POSIX_TIME tx = localtime(&utime); #ifdef DATEDEBUG ! #ifdef HAVE_INT_TIMEZONE printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s %s dst=%d\n", tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, sec, tzname[0], tzname[1], tx->tm_isdst); #else ! printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s dst=%d\n", ! tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, sec, ! tx->tm_zone, tx->tm_isdst); #endif - #else #endif tm->tm_year = tx->tm_year + 1900; tm->tm_mon = tx->tm_mon + 1; --- 2415,2431 ---- #ifdef USE_POSIX_TIME tx = localtime(&utime); #ifdef DATEDEBUG ! #if defined(HAVE_TM_ZONE) ! printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s dst=%d\n", ! tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, sec, ! tx->tm_zone, tx->tm_isdst); ! #elif defined(HAVE_INT_TIMEZONE) printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02.0f %s %s dst=%d\n", tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, sec, tzname[0], tzname[1], tx->tm_isdst); #else ! #error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined #endif #endif tm->tm_year = tx->tm_year + 1900; tm->tm_mon = tx->tm_mon + 1; *************** *** 2442,2459 **** #endif tm->tm_isdst = tx->tm_isdst; ! #ifdef HAVE_INT_TIMEZONE ! *tzp = (tm->tm_isdst ? (timezone - 3600) : timezone); ! if (tzn != NULL) ! *tzn = tzname[(tm->tm_isdst > 0)]; ! ! #else /* !HAVE_INT_TIMEZONE */ tm->tm_gmtoff = tx->tm_gmtoff; tm->tm_zone = tx->tm_zone; *tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ if (tzn != NULL) ! *tzn = tm->tm_zone; #endif #else /* !USE_POSIX_TIME */ --- 2444,2462 ---- #endif tm->tm_isdst = tx->tm_isdst; ! #if defined(HAVE_TM_ZONE) tm->tm_gmtoff = tx->tm_gmtoff; tm->tm_zone = tx->tm_zone; *tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ if (tzn != NULL) ! *tzn = (char *)tm->tm_zone; ! #elif defined(HAVE_INT_TIMEZONE) ! *tzp = (tm->tm_isdst ? (timezone - 3600) : timezone); ! if (tzn != NULL) ! *tzn = tzname[(tm->tm_isdst > 0)]; ! #else ! #error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined #endif #else /* !USE_POSIX_TIME */ *************** *** 2488,2494 **** #ifdef DATEDEBUG #ifdef USE_POSIX_TIME ! #ifdef HAVE_INT_TIMEZONE printf("datetime2tm- timezone is %s; offset is %d (%d); daylight is %d\n", tzname[tm->tm_isdst != 0], ((tzp != NULL) ? *tzp : 0), CTimeZone, CDayLight); #endif --- 2491,2500 ---- #ifdef DATEDEBUG #ifdef USE_POSIX_TIME ! #if defined(HAVE_TM_ZONE) ! printf("datetime2tm- timezone is %s; offset is %d\n", ! tm->tm_zone, ((tzp != NULL) ? *tzp : 0)); ! #elif defined(HAVE_INT_TIMEZONE) printf("datetime2tm- timezone is %s; offset is %d (%d); daylight is %d\n", tzname[tm->tm_isdst != 0], ((tzp != NULL) ? *tzp : 0), CTimeZone, CDayLight); #endif *************** *** 3034,3044 **** tm->tm_year += 1900; tm->tm_mon += 1; ! #ifdef HAVE_INT_TIMEZONE ! *tzp = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone); ! ! #else /* !HAVE_INT_TIMEZONE */ *tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ #endif #else /* !USE_POSIX_TIME */ --- 3040,3051 ---- tm->tm_year += 1900; tm->tm_mon += 1; ! #if defined(HAVE_TM_ZONE) *tzp = -(tm->tm_gmtoff); /* tm_gmtoff is Sun/DEC-ism */ + #elif defined(HAVE_INT_TIMEZONE) + *tzp = ((tm->tm_isdst > 0) ? (timezone - 3600) : timezone); + #else + #error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined #endif #else /* !USE_POSIX_TIME */ *************** *** 4104,4115 **** #ifdef DATEDEBUG #ifdef USE_POSIX_TIME ! #ifdef HAVE_INT_TIMEZONE printf("EncodeDateTime- timezone is %s (%s); offset is %d (%d); daylight is %d (%d)\n", *tzn, tzname[0], *tzp, CTimeZone, tm->tm_isdst, CDayLight); #else ! printf("EncodeDateTime- timezone is %s (%s); offset is %ld (%d); daylight is %d (%d)\n", ! *tzn, tm->tm_zone, (-tm->tm_gmtoff), CTimeZone, tm->tm_isdst, CDayLight); #endif #else printf("EncodeDateTime- timezone is %s (%s); offset is %d; daylight is %d\n", --- 4111,4124 ---- #ifdef DATEDEBUG #ifdef USE_POSIX_TIME ! #if defined(HAVE_TM_ZONE) ! printf("EncodeDateTime- timezone is %s (%s); offset is %ld (%d); daylight is %d (%d)\n", ! *tzn, tm->tm_zone, (-tm->tm_gmtoff), CTimeZone, tm->tm_isdst, CDayLight); ! #elif defined(HAVE_INT_TIMEZONE) printf("EncodeDateTime- timezone is %s (%s); offset is %d (%d); daylight is %d (%d)\n", *tzn, tzname[0], *tzp, CTimeZone, tm->tm_isdst, CDayLight); #else ! #error USE_POSIX_TIME is defined but neither HAVE_TM_ZONE or HAVE_INT_TIMEZONE are defined #endif #else printf("EncodeDateTime- timezone is %s (%s); offset is %d; daylight is %d\n",