Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save trycf/df3023f1d06ca07a33879ef87e89258b to your computer and use it in GitHub Desktop.
Save trycf/df3023f1d06ca07a33879ef87e89258b to your computer and use it in GitHub Desktop.
TryCF Gist
<cfscript>
CurrentMonth = MonthAsString(Month(Now()));
NextMonth = MonthAsString(Month(DateAdd('m', 1, Now())));
CurrentMonthFrom = DateFormat(Now(), 'yyyy-mm-01');
NextMonthFrom = DateFormat(DateAdd('m', 1, CurrentFrom), 'yyyy-mm-01');
CurrentMonthTo = DateAdd('d', -1, DateAdd('m', 1, CurrentMonthFrom));
NextNextMonthTo = NextMonthFrom = DateFormat(DateAdd('m', 2, CurrentFrom), 'yyyy-mm-01');
NextMonthTo = DateFormat(DateAdd('m', 1, NextNextMonthTo), 'yyyy-mm-01');
writeDump(CurrentMonth);
writeOutput('<br>');
writeDump(NextMonth);
writeOutput('<br>');
writeDump(CurrentMonthFrom);
writeOutput('<br>');
writeDump(CurrentMonthTo);
writeOutput('<br>');
writeDump(NextMonthFrom);
writeOutput('<br>');
writeDump(NextMonthTo);
writeOutput('<br>');
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment