Looping through dates, but October 2016 displays Sun 30th Oct twice - but no Mon 31st Oct?! All other 2016 months displays fine.
Hello EE,
This has been driving me nuts, as I'm sure it is my error somewhere, but cannot work it out? Why does, when looping through with my php code, 1st to 31st October 2016, does it display Sun 30th October twice and no Mon 31st Oct?! All other 2016 months display fine?
October
Sat 1st Oct
Sun 2nd Oct
Mon 3rd Oct
Tue 4th Oct
Wed 5th Oct
Thu 6th Oct
Fri 7th Oct
Sat 8th Oct
Sun 9th Oct
Mon 10th Oct
Tue 11th Oct
Wed 12th Oct
Thu 13th Oct
Fri 14th Oct
Sat 15th Oct
Sun 16th Oct
Mon 17th Oct
Tue 18th Oct
Wed 19th Oct
Thu 20th Oct
Fri 21st Oct
Sat 22nd Oct
Sun 23rd Oct
Mon 24th Oct
Tue 25th Oct
Wed 26th Oct
Thu 27th Oct
Fri 28th Oct
Sat 29th Oct Sun 30th Oct
Sun 30th Oct
Whereas November and December 2016 work fine;
November
Tue 1st Nov
Wed 2nd Nov
Thu 3rd Nov
Fri 4th Nov
Sat 5th Nov
Sun 6th Nov
Mon 7th Nov
Tue 8th Nov
Wed 9th Nov
Thu 10th Nov
Fri 11th Nov
Sat 12th Nov
Sun 13th Nov
Mon 14th Nov
Tue 15th Nov
Wed 16th Nov
Thu 17th Nov
Fri 18th Nov
Sat 19th Nov
Sun 20th Nov
Mon 21st Nov
Tue 22nd Nov
Wed 23rd Nov
Thu 24th Nov
Fri 25th Nov
Sat 26th Nov
Sun 27th Nov
Mon 28th Nov
Tue 29th Nov
Wed 30th Nov
December
Thu 1st Dec
Fri 2nd Dec
Sat 3rd Dec
Sun 4th Dec
Mon 5th Dec
Tue 6th Dec
Wed 7th Dec
Thu 8th Dec
Fri 9th Dec
Sat 10th Dec
Sun 11th Dec
Mon 12th Dec
Tue 13th Dec
Wed 14th Dec
Thu 15th Dec
Fri 16th Dec
Sat 17th Dec
Sun 18th Dec
Mon 19th Dec
Tue 20th Dec
Wed 21st Dec
Thu 22nd Dec
Fri 23rd Dec
Sat 24th Dec
Sun 25th Dec
Mon 26th Dec
Tue 27th Dec
Wed 28th Dec
Thu 29th Dec
Fri 30th Dec
Sat 31st Dec
Many thanks, the help you both provided is very much appreciated and resolved my problem code - Ferruccio for the solution and Brian for explaining why my script wasn't working
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
ASKER
Yes, very strange - thank you for the workaround, it sorts the problem and is very much appreciated.
regards
Jamie