Wed Dec 1 11:21:09 2004

Ticket #472 (Closed: fixed)

create an XML-RPC function for Scheduler that returns the current time on the scheduler


Priority: normal Reporter: maroy
Severity: feature Assigned to: fgerlits
Component: HTML UI Status: closed
Version:   Resolution: fixed
Milestone:   Keywords:  

Description by maroy:

create an XML-RPC function, that will return the current time on the scheduler machine, up to seconds precision.

Attachments

Changelog

Fri Dec 10 20:11:42 2004: Modified by fgerlits

  • resolution set to fixed
  • status changed from assigned to closed

Done -- it's called getSchedulerTime. It doesn't use push yet, because I don't know how; will update it after I figure that out.

Mon Dec 13 15:31:15 2004: Modified by maroy

  • status changed from closed to assigned

the implementation is bad. pleae read the man page for time.h: man time.h The <time.h> header shall declare the structure tm, which shall include at least the following members: int tm_sec Seconds [0,60]. int tm_min Minutes [0,59]. int tm_hour Hour [0,23]. int tm_mday Day of month [1,31]. int tm_mon Month of year [0,11]. int tm_year Years since 1900. int tm_wday Day of week [0,6] (Sunday =0). int tm_yday Day of year [0,365]. int tm_isdst Daylight Savings flag. and note, that the field tm_year for the year 2004 is 104, the field tm_mon for December is not 12 but 11. please update the implementation to return a proper time value.

Mon Dec 13 16:16:02 2004: Modified by maroy

    also, please using functions from Core::TimeConversion?. this piece of code in GetSchedulerTimeMethod?: ptime schedulerPTime = second_clock::local_time(); date schedulerDate

    schedulerPTime.date(); time_duration schedulerTimeOfDay

    schedulerPTime.time_of_day(); struct tm schedulerTime; schedulerTime.tm_year = schedulerDate.year(); schedulerTime.tm_mon

    schedulerDate.month(); schedulerTime.tm_mday

    schedulerDate.day(); schedulerTime.tm_hour = schedulerTimeOfDay.hours(); schedulerTime.tm_min = schedulerTimeOfDay.minutes(); schedulerTime.tm_sec = schedulerTimeOfDay.seconds(); could rather be: ptime schedulerPTime = TimeConversion?::now(); struct tm schedulerTime; TimeConversion?::ptimeToTm(schedulerPTime, schedulerTime); from the above, TimeConversion?::ptimeToTm() does not exist yet, but other, similar conversion routines are there already.

    Mon Dec 13 19:00:57 2004: Modified by fgerlits

      It seems to me that the XmlRpc++ conversion routines are bad, then. Surely, we want to return something like <dateTime.iso8601>20041213T17:54:38</dateTime.iso8601> and not <dateTime.iso8601>01041113T17:54:38</dateTime.iso8601> for December 13, 2004?

      Mon Dec 13 20:09:34 2004: Modified by maroy

        hm. so, if you set mt_year = 104, it sends a date with the year 104, instead of 2004? are you sure? did you check? than please patch the XmlRpc++ sources, and add the patch to the tools/xmlrpc++/xmlrpc++-20040713/etc directory (there are already two patches there), and modify install.sh to apply the new patch...

        Mon Dec 13 20:24:40 2004: Modified by fgerlits

          Well, I checked that it worked fine with the incorrect struct tm's. Now I checked it properly, and it's actually even worse, it doesn't even send "01041213" but "1041213", and if you set the year to 1899 (time.tm_year == -1), you'll get "-11213".

          Mon Dec 13 20:28:26 2004: Modified by maroy

            ok, please fix XmlRpc++ then, create a patch, add it to the appropriate etc directory in tools, and post a bug report for them as well, with the patch attached...

            Mon Dec 13 21:22:56 2004: Modified by fgerlits

              Well, that wasn't quite true -- the toXml() function handles the year properly, but not the month; it's only the ostream& operator<< function that bungles both.

              Mon Dec 13 23:49:57 2004: Modified by fgerlits

              • status changed from assigned to closed

              OK, I think it works now.

              Tue Dec 14 01:08:55 2004: Modified by maroy

                ok, what do I need to do? do I need to recompile XmlRpc++ as well?

                Tue Dec 14 12:41:39 2004: Modified by fgerlits

                • resolution cleared
                • status changed from closed to assigned

                Yes, get the patch from cvs, and then run ./tools/xmlrpc++/xmlrpc- something/bin/install.sh.

                Tue Dec 14 12:42:22 2004: Modified by fgerlits

                • resolution set to fixed
                • status changed from assigned to closed

                Tue Dec 14 12:45:03 2004: Modified by fgerlits

                • resolution cleared
                • status changed from closed to assigned

                Tue Dec 14 12:45:33 2004: Modified by fgerlits

                • resolution set to fixed
                • status changed from assigned to closed

                And of course, recompile the core module, too. (This is really annoying, having to reopen every time I want to add a note.)

                Tue Dec 14 14:49:07 2004: Modified by maroy

                  great! can you please share the patch with the XmlRpc++ team as well, e.g. here: http://sourceforge.net/tracker/?atid=528555&group_id=70654&func=browse (you might even want to open a bug issue there, and point to the patch as a solution) thanks...

                  Fri Oct 7 15:26:04 2005: Modified by 윤모짱

                  • component set to HTML UI

                  <A HREF="http://www.divx.cn.pn" target="_blank">

                  **뽀.르.노.p.2.p.공.유.중** 전.세.계.동.영.상.무.료.공.유.중 A.V.걸.들.노,모,자,이,크,무,삭,제,공,유,중

                  http://www.divx.cn.pn

                  http://www.divx.cn.pn

                  삭@@@@제: ioio7

                  </a>


                  Add/Change #472 (create an XML-RPC function for Scheduler that returns the current time on the scheduler)




                  Change Properties






                  Action