Contributing Advent 9: Day of the week
This is another one in the Date/Time extension series. Bugs #63391 and #61599 both deal with PHP getting the Day of Week wrong in years before 1600. Technically I did not write the patch for this contribution, but I did add tests, verified it and merged it to all the four branches (PHP 5.4, 5.5, 5.6 and master).
However, it does seem that I introduced the bug in the first place. When writing the new date/time support about 7 years ago I was looking for an algorithm that would tell me the day of the week for any given (Gregorian calendar) date. Wikipedia has quite a good article on it. The article outlines the calculation of the century number. For the Gregorian calendar, that's quite straight forwards: 6 - (j % 4) * 2. For the Julian calendar it's not very difficult either. Although PHP uses the proleptic Gregorian calendar that I wrote about before, I mistakenly had used a formula that combined the Julian and Gregorian calendar calculations. This then resulted in wrong calculations before the year 1600. This is now corrected and ready for inclusion into PHP 5.4.24, 5.5.7, and later versions.
Life Line
Updated an atm and an amusements shop
Updated a crossing
I walked 8.5km in 1h37m44s
Merged pull request #1059
Disable statement handler when not connected
There is a new consultation out in the UK for Digital ID Cards: https://www.gov.uk/government/consultations/making-public-services-work-for-you-with-your-digital-identity
#OnlineSafety #onlineSafetyAct #legislation #consultation #UK
Confirmed a fast_food
Updated a bench
Updated a bench
I walked 5.3km in 1h2m15s
Updated a community_centre
I walked 8.7km in 1h52m18s
I walked 0.8km in 9m36s
Created an office
I walked 10.0km in 3h10m10s
I walked 0.8km in 10m14s
Updated a pub
Updated a restaurant; Confirmed a studio
I walked 1.6km in 19m27s
I walked 4.2km in 46m45s
I walked 1.7km in 16m23s
Created 9 picnic_tables, 2 pitches, and a bench; Updated 5 benches; Deleted a pitch
I walked 5.8km in 1h9m48s
I had this lovely Robin posing for me on my walk last weekend.
#BirdPhotogaphy #BirdsOfMastodon #Birds #photography #NorthDowns



Shortlink
This article has a short URL available: https://drck.me/adv1309-af1