pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:5717:    hour--, min += 60;    if ((hour %= 24) < 0)    hour += 24;    normalised_time = ((hour * 60) + min) * 60 + sec;       /* date.tm_zone = NULL; */    retval = mktime(&date);       if((args > 7) && (SUBTYPEOF(Pike_sp[7-args]) == NUMBER_NUMBER))    { +  normalised_time -= ((date.tm_hour * 60) + date.tm_min) * 60 + date.tm_sec; +  if (normalised_time < -12*60*60) +  normalised_time += 24*60*60; +  else if (normalised_time > 12*60*60) +  normalised_time -= 24*60*60; + #ifdef STRUCT_TM_HAS___TM_GMTOFF +  retval += date.__tm_gmtoff; + #elif defined(STRUCT_TM_HAS_GMTOFF) +  retval += date.tm_gmtoff; + #else    normalised_time = retval - mktime(gmtime(&retval)); -  + #endif    retval += normalised_time + tz;    }    if (date.tm_wday < 0)    PIKE_ERROR("mktime", "Time conversion unsuccessful.\n", Pike_sp, args);       pop_n_elems(args);   #if SIZEOF_TIME_T > SIZEOF_INT_TYPE    push_int64 (retval);   #else    push_int(retval);