How to schedule timer to run on last day of every month from application?

How to schedule timer to run on last day of every month from application?


Is there anyway we can schedule a timer to run on last day of every month? I need to provide an option in the application where user can schedule an action to be run daily, weekly, monthly, on a certain weekday of the month or on the last day of the month. 

All the other scheduling options are fairly simple except for the last day of the month as there doesn't seem to be any expression for this kind of scheduling.

Could anyone please help me with this. Thanks in advance!!
make 2 timers.

1 timer runs every day.
check if it's the end of the month, if so, wake the real timer.
otherwise end it.

@J.: I don't see why that would be different from doing the check in the real timer in the first place?

@Tarun: What it comes down to, is what you are asking is not possible with the platform. If the use case at all permits it, I'd schedule that timer on the first day of the month, and process whatever you need from the previous month. If that's a no-no, you can either schedule the timer e.g. at 28, 29, 30 and 31 of each month, and hard code a check to see if it is really the last day of the month, exit if not, proceed if it is. Or, you could go even more advanced and write a timer scheduler yourself, but I'd recommend against it.
@kilian easy, splitting up of logic. The actual timer can be run within servicecenter for testing adhoc purposes. The time to decide if the actual timer runs, is split up and can be changed easily...
@Killian @J, Thanks for your replys. I ended up doing the same thing and created a timer which will run on 15th of every month and update the other timer to run on the last day of that month.

@J: You are right, depending on the use case, splitting is better.

@Tarun: great to hear you've solved it.