Branch: Tag:

2001-06-09

2001-06-09 11:24:30 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

bugfix; unix_time weren't aligned for minutes and hours

Rev: lib/modules/Calendar.pmod/Time.pmod:1.14

155:   // 1970-01-01 is julian day 2440588    jd-=2440588;    float fjd=(jd-(int)jd)-0.5; -  ux=((int)jd)*86400+(int)(fjd*86400); +     ls=CALUNKNOWN; -  +  create_unixtime_default(((int)jd)*86400+(int)(fjd*86400));    }      // make base
403:   // minutes are on the day, adjust for timezone (non-full-minute timezones!)    if (ls==CALUNKNOWN) make_local();    int zx=ux-ls%60; +  werror("ux %O %O zx %O\n",ux,ls%60,zx);       if (!n || (n==-1 && !len))    return Minute("timeofday",rules,zx,60);
1179:    create_unixtime(time(),3600);    }    +  static void create_unixtime(int _ux,int _len) +  { +  ::create_unixtime(_ux,_len); +  if (ls==CALUNKNOWN) make_local(); +  if (ls%3600) ux-=ls%3600,ls=CALUNKNOWN; +  } +     static void create_julian_day(int|float jd)    {    ::create_julian_day(jd);
1247:       inherit TimeofDay;    +  static void create_unixtime(int _ux,int _len) +  { +  werror("%O\n",_ux); +  ::create_unixtime(_ux,_len); +  if (ls==CALUNKNOWN) make_local(); +  ux-=ls%60; +  } +     void create_unixtime_default(int unixtime)    {    create_unixtime(unixtime,60);