summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-12 21:17:18 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-04-12 21:17:18 (GMT)
commitc7a20762743c94893cd815bed31fd8c83ee86b12 (patch)
tree721635fa5dd1342645e7396857f1587d64863602 /unix
parent7a6d97a527bd8148991a5a5da76fb6f75abd687e (diff)
parenta023aca95e9b16b2d3fb63919b5f25f6279fd3b0 (diff)
downloadtcl-c7a20762743c94893cd815bed31fd8c83ee86b12.zip
tcl-c7a20762743c94893cd815bed31fd8c83ee86b12.tar.gz
tcl-c7a20762743c94893cd815bed31fd8c83ee86b12.tar.bz2
[Bug 3514475]: remove TclpGetTimeZone and TclpGetTZName
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixTime.c116
1 files changed, 0 insertions, 116 deletions
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 02a90a5..c7921fe 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -224,122 +224,6 @@ TclpWideClicksToNanoseconds(
/*
*----------------------------------------------------------------------
*
- * TclpGetTimeZone --
- *
- * Determines the current timezone. The method varies wildly between
- * different platform implementations, so its hidden in this function.
- *
- * Results:
- * The return value is the local time zone, measured in minutes away from
- * GMT (-ve for east, +ve for west).
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclpGetTimeZone(
- unsigned long currentTime)
-{
- int timeZone;
-
- /*
- * We prefer first to use the time zone in "struct tm" if the structure
- * contains such a member. Following that, we try to locate the external
- * 'timezone' variable and use its value. If both of those methods fail,
- * we attempt to convert a known time to local time and use the difference
- * from UTC as the local time zone. In all cases, we need to undo any
- * Daylight Saving Time adjustment.
- */
-
-#if defined(HAVE_TM_TZADJ)
-#define TCL_GOT_TIMEZONE
- /*
- * Struct tm contains tm_tzadj - that value may be used.
- */
-
- time_t curTime = (time_t) currentTime;
- struct tm *timeDataPtr = TclpLocaltime(&curTime);
-
- timeZone = timeDataPtr->tm_tzadj / 60;
- if (timeDataPtr->tm_isdst) {
- timeZone += 60;
- }
-#endif
-
-#if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE)
-#define TCL_GOT_TIMEZONE
- /*
- * Struct tm contains tm_gmtoff - that value may be used.
- */
-
- time_t curTime = (time_t) currentTime;
- struct tm *timeDataPtr = TclpLocaltime(&curTime);
-
- timeZone = -(timeDataPtr->tm_gmtoff / 60);
- if (timeDataPtr->tm_isdst) {
- timeZone += 60;
- }
-#endif
-
-#if defined(HAVE_TIMEZONE_VAR) && !defined(TCL_GOT_TIMEZONE) && !defined(USE_DELTA_FOR_TZ)
-#define TCL_GOT_TIMEZONE
- /*
- * The 'timezone' external var is present and may be used.
- */
-
- SetTZIfNecessary();
-
- /*
- * Note: this is not a typo in "timezone" below! See tzset documentation
- * for details.
- */
-
- timeZone = timezone / 60;
-#endif
-
-#if !defined(TCL_GOT_TIMEZONE)
-#define TCL_GOT_TIMEZONE
- /*
- * Fallback - determine time zone with a known reference time.
- */
-
- time_t tt;
- struct tm *stm;
-
- tt = 849268800L; /* 1996-11-29 12:00:00 GMT */
- stm = TclpLocaltime(&tt); /* eg 1996-11-29 6:00:00 CST6CDT */
-
- /*
- * The calculation below assumes a max of +12 or -12 hours from GMT.
- */
-
- timeZone = (12 - stm->tm_hour)*60 + (0 - stm->tm_min);
- if (stm->tm_isdst) {
- timeZone += 60;
- }
-
- /*
- * Now have offset for our known reference time, eg +360 for CST6CDT.
- */
-#endif
-
-#ifndef TCL_GOT_TIMEZONE
- /*
- * Cause fatal compile error, we don't know how to get timezone.
- */
-
-#error autoconf did not figure out how to determine the timezone.
-#endif
-
- return timeZone;
-}
-
-/*
- *----------------------------------------------------------------------
- *
* Tcl_GetTime --
*
* Gets the current system time in seconds and microseconds since the