refactored the calculation of a timespan from a cron schedule