2 Replies Latest reply on Feb 23, 2009 8:23 AM by DynamicGuyNC

    Problem with CFSchedule

      I have a script that I'm trying to insert into the CF Scheduler that will run from the time its submitted (via <cfschedule> tag) for 6 hours.

      The script I have works great if you start at least 6.5 hours prior to midnight (ie you start it at 1pm, it will run till 7pm and shut off). But if you start it at 6:01pm or later it almost appears as if the <cfschedule> tag is completely ignoring the date information passed to it and gives me an error.

      The code is included.

      Here's the results of some cfoutputs:
      SchStart: {ts '2009-02-19 22:42:29'}
      SchEnd: {ts '2009-02-20 04:42:14'}
      SchStartDate: 02-19-2009
      SchStartTime: 22:42
      SchEndDate: 02-20-2009
      SchEndTime: 04:42

      And here's the error I get:
      Invalid parameters have been passed to the scheduling service. Parameter {ts '1899-12-30 22:42:00'} should be earlier than parameter {ts '1899-12-30 04:42:00'}.

      I've tried EVERY date format mask that CF allows, and every time it converts the time correctly but ignores the date and tries to insert the 1899 date. Even with the cfoutputs showing that the dates are there and formatted correctly.

      Please help!
        • 1. Re: Problem with CFSchedule
          Avatar Level 1
          The short answer is that when this script is run after 6 pm, the SchEnd becomes a date for the following day with a time earlier than the starttime (SchStart) . Since this is a daily task, it cannot span multiple days nor can it have an end time earlier than the start time.

          If you were to make sure that the enddate was the same as the startdate and that the end time was no more than 23:59, it will work.
          • 2. Re: Problem with CFSchedule
            DynamicGuyNC Level 1
            So I guess it doesn't look at the combination of the date and time to see if its a valid date in the future, just once piece at a time. Kinda odd that they wouldn't incorporate something like that from the get go.

            Thanks for the input, I'll have to tweak my code a bit to make sure it never spans a second day, but it shouldn't be a problem.