Skip to main content
Known Participant
July 2, 2013
Question

schedule task

  • July 2, 2013
  • 2 replies
  • 632 views

Hi,

I am setting up the schedule task to run my cfm page.  I’d like this task to run on the last day of each month.  How can I accomplished this since each month is different, some have 30, or 31 or 28, 29 days…..?

Thanks

This topic has been closed for replies.

2 replies

p_sim
Participating Frequently
July 12, 2013

Hi newcf,

Your question and answer are in the ColdFusion documentation.

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c6e.html

  • If you schedule a monthly job to run on the last day of a month, the scheduled job will run on the last day of each month. For example, if you schedule a monthly job to start on January 31, it will run on January 31, February 28 or 29, March 31, April 30, and so on.


BKBK
Community Expert
Community Expert
July 12, 2013

Cool! I forgot about interval="monthly".


BKBK
Community Expert
Community Expert
July 7, 2013

Did you try something like this?

<!--- StartDate in format mm/DD/yyyy, where DD is cardinality of last day of current month--->

<cfset strtDt = month(now()) & "/" & DaysInMonth(now()) & "/" & year(now())>

<cfschedule startDate = "#strtDt#">