I couldn't find a simple routine for doing this, but found several people asking for one, so I put this together. It could probably be done more elegantly, but it's simple to understand this way. It seems to work ok for the few future years I've tested it for - as long as the Queen doesn't live for another ten years and there isn't another royal wedding!
PHP Code:
<?php
// BANK HOLIDAYS IN ENGLAND AND WALES AS JULIAN DAYS
$statYear = 2015;//FOR EXAMPLE
$firstJan = cal_to_jd (CAL_GREGORIAN, 1,1,$statYear );//NEW YEARS DAY - 1st of Jan unless its a Sat or Sun
if ( JDDayOfWeek ( $firstJan ) == 6 ) $firstJan += 2;
if ( JDDayOfWeek ( $firstJan ) == 0 ) $firstJan += 1;
$goodFriday = unixtojd (easter_date ( $statYear )) -2;//GOOD FRIDAY AND EASTER MONDAY determined by Easter Day which is 1st Sunday after 1st full moon after vernal equinox
$easterMonday = unixtojd (easter_date ( $statYear )) +1;
$firstDayThisMonth = cal_to_jd (CAL_GREGORIAN, 5,1,$statYear);//MAY BANK HOLIDAY - First Monday in May
for ($i = $firstDayThisMonth;$i<= $firstDayThisMonth + 6;$i++){
if (JDDayOfWeek($i)== 1) $mayDay = $i;
}
$firstDayThisMonth = cal_to_jd (CAL_GREGORIAN, 5,1,$statYear);//SPRING BANK HOLIDAY - Last Monday in May
for ($i = $firstDayThisMonth;$i<= $firstDayThisMonth + 30;$i++){
if (JDDayOfWeek($i)== 1) $springDay = $i;
}
$firstDayThisMonth = cal_to_jd (CAL_GREGORIAN, 8,1,$statYear);//SUMMER BANK HOLIDAY - Last Monday in August
for ($i = $firstDayThisMonth;$i<= $firstDayThisMonth + 30;$i++){
if (JDDayOfWeek($i)== 1) $summerDay = $i;
}
$xmasDay = cal_to_jd (CAL_GREGORIAN, 12,25,$statYear);//XMAS DAY - 25th of Dec unless its a Sat or Sun
$boxingDay = cal_to_jd (CAL_GREGORIAN, 12,26,$statYear);//BOXING DAY - 26th of Dec unless its a Sat or Sun
if ( JDDayOfWeek ( $xmasDay ) == 5 ) $boxingDay += 2;
if ( JDDayOfWeek ( $xmasDay ) == 6 ) {
$xmasDay += 2;
$boxingDay += 2;
}
if ( JDDayOfWeek ( $xmasDay ) == 0 ) {
$xmasDay += 1;
$boxingDay += 1;
}
$bankHolidays = array ($firstJan,$goodFriday,$easterMonday,$mayDay,$springDay,$summerDay,$xmasDay,$boxingDay);
?>