pike.git / lib / modules / Calendar.pmod / Time.pmod

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Time.pmod:148:    ls=CALUNKNOWN;    }       static void create_now();       void create_julian_day(int|float jd)    {   // 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   // needed in ymd   /*static*/ TimeRange make_base()    {    base=Day("unix_r",ux,rules);    if (len) base=base->range(Day("unix_r",ux+len,rules));   // werror("make base -> %O\n",base);    return base;
pike.git/lib/modules/Calendar.pmod/Time.pmod:396:   //!   //! <ref>number_of_minutes</ref>() simple counts the   //! number of minutes containing the called time period.   //!       cMinute minute(void|int n)    {   // 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);    if (n<0) n=number_of_minutes()+n;    if (n<0 || n*60>=len+ux-zx)    error("minute not in timerange (minute 0..%d exist)\n",(len-1)/60);    return Minute("timeofday",rules,zx+60*n,60)->autopromote();    }       int number_of_minutes()
pike.git/lib/modules/Calendar.pmod/Time.pmod:1172:    void create_unixtime_default(int unixtime)    {    create_unixtime(unixtime,3600);    }       static void create_now()    {    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);    len=3600;    }       static void convert_from(TimeRange other)    {    ::convert_from(other);    len-=len%3600;
pike.git/lib/modules/Calendar.pmod/Time.pmod:1240:      function(mixed...:cMinute) Minute=cMinute; // inheritance purposes   class cMinute   {    constant is_minute=1;      //! inherits TimeofDay       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);    }       static void create_now()    {    create_unixtime(time()/60*60,60);    }