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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/Time.pmod:174:    ls=ux-base->unix_time();    if (rules->timezone->is_dst_timezone)    {    if (utco==CALUNKNOWN)    [utco,tzn]=rules->timezone->tz_ux(ux);    if (utco!=base->utc_offset())    ls+=base->utc_offset()-utco;    }    }    +  TimeRange `*(int|float n) +  { +  if(intp(n)) +  return set_size(n,this); +  else +  return second()*(int)(how_many(Second)*n); +  } +  +  array(TimeRange) split(int|float n, void|function|TimeRange with) +  { +  if(!with) +  with=Second; +  if (functionp(with)) with=promote_program(with); +  float length=how_many(with)/(float)n; +  TimeRange start=beginning(); +  TimeRange end=end(); +  array result=({}); +  while(start+with*length < end) +  { +  result += ({ start->distance(start+with*length) }); +  start=start+with*length; +  } +  result += ({ start->distance(end) }); +  return result; +  } +    // default autopromote    this_program autopromote()    {    return this;    }       array(int(-1..1)) _compare(TimeRange with)    {   #define CMP(A,B) ( ((A)<(B))?-1:((A)>(B))?1:0 )