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

version» Context lines:

pike.git/lib/modules/Calendar.pmod/YMD.pmod:2354:   //! <ref>Ruleset.set_abbr2zone</ref>.         // dwim time of day; needed to correct timezones   // this API may change without further notice   static TimeRange dwim_tod(TimeRange origin,string whut,int h,int m,int s)   {    TimeRange tr=origin[whut](h,m,s);    if (tr->hour_no()!=h || tr->minute_no()!=m)    { + // werror("%O %O %O -> %O %O %O (%O)\n", + // tr->hour_no(),tr->minute_no(),tr->second_no(), + // h,m,s,tr);    if (tr->hour_no()!=h)    tr=tr->add(h-tr->hour_no(),Hour);    if (tr->minute_no()!=m)    tr=tr->add(m-tr->minute_no(),Minute);    if (tr->second_no()!=s)    tr=tr->add(s-tr->second_no(),Second);    if (tr->hour_no()!=h || tr->minute_no()!=m ||    tr->second_no()!=s) return 0; // no such hour    }    return tr;