Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • pike pike
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 106
    • Issues 106
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #2584
Closed
Open
Issue created Nov 30, 2001 by Peter Bortas@zinoOwner

localtime() doesn't setup "timezone" in the mapping

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=2584

Reported by Xavier Beaudouin, ISDnet kiwi@isdnet.net

Configure script doesn't find that struct tm has tm_gmtoff member :

--/--- According to the man page of localtime() on FreeBSD 4.4 :

External declarations as well as the tm structure definition are in the <time.h> include file. The tm structure includes at least the following fields:

       int tm_sec;     /* seconds (0 - 60) */
       int tm_min;     /* minutes (0 - 59) */
       int tm_hour;    /* hours (0 - 23) */
       int tm_mday;    /* day of month (1 - 31) */
       int tm_mon;     /* month of year (0 - 11) */
       int tm_year;    /* year - 1900 */
       int tm_wday;    /* day of week (Sunday = 0) */
       int tm_yday;    /* day of year (0 - 365) */
       int tm_isdst;   /* is summer time in effect? */
       char *tm_zone;  /* abbreviation of timezone name */
       long tm_gmtoff; /* offset from UTC in seconds */

--/---

So there is some problems in the detection of tm_gmtoff in autoconf script.

Also I've found in pike 7.2.234 some typos in that avoid pike to be compiled when STRUCT_TM_HAS_GMTOFF is forced in machine.h

Here is a diff to correct this :

--- builtin_functions.c.orig Wed Oct 31 02:18:18 2001
+++ builtin_functions.c Fri Nov 30 20:10:58 2001
@@ -4029,10 +4029,10 @@
 #if STRUCT_TM_HAS_GMTOFF
   if((args > 7) && (Pike_sp[7-args].subtype == NUMBER_NUMBER))
   {
-    date.tm_gmtoff=Pike_sp[7-args].u.intger;
+    date.tm_gmtoff=Pike_sp[7-args].u.integer;
   }else{
     time_t tmp = 0;
-    data.tm_gmtoff=localtime(&tmp).tm_gmtoff;
+    date.tm_gmtoff=localtime(&tmp)->tm_gmtoff;
   }
   retval=mktime(&date);
 #else
Assignee
Assign to
Time tracking