Hi all
I can't think of a simple way of establishing the day and month values for the end of the previous month when only providing the month number of the current month.
This is to calculate a financial year start and end from only the start month.
For example, if the start month is 7 the year end is 30/06. If the start month is 1, the year end is 31/12.
Does anyone have a neater way doing this than my example?
Thanks!
if $fyearstartmonth == '1' {
$fyearstartmonth = '13';
}
$fyearendmonth = $fyearstartmonth - 1;
$fyearendday = date ("t", mktime(0, 0, 0, $yearendmonth, 1, 2000));