Skip to content

Instantly share code, notes, and snippets.

@mtdowling
Created January 16, 2012 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtdowling/1622221 to your computer and use it in GitHub Desktop.
Save mtdowling/1622221 to your computer and use it in GitHub Desktop.
get the next 5 mondays from now using cron expression
<?php
// See https://github.com/mtdowling/cron-expression
require 'cron.phar';
$totalWeeks = 5;
$fromDate = 'now';
$cron = Cron\CronExpression::factory('0 0 * * 1');
$dates = $cron->getMultipleRunDates($totalWeeks, $fromDate);
var_export($dates);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment