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
What new fresh hell is this?
"Please click here and tick the box if you DO NOT want to be opted in."
And when you click on the non-visible link:
"[ ] I DO NOT want to be opted in."
@jamesholden Have you ever seen the Expanse? One of the main characters shares your name!
I walked 4.4km in 51m58s
I walked 8.2km in 1h40m07s
I walked 2.4km in 38m25s
@Edent With your ActivityPub implementation, have you figured out how to allow quote posts for your bot posts yet?
📷 Brown Cap in the Grass
🚩 Herikhuizerweg, Rheden, Nederland
I walked 0.9km in 11m17s
I walked 2.8km in 25m32s
I walked 4.6km in 1h8m02s
📷 Stalkers Lane
🚩 Graywood Lane, Wealden, United Kingdom
I hiked 23.0km in 4h10m15s
I walked 3.9km in 39m07s
After my PHP 8.5 in Leeds last night, it's now time to head to Rotterdam to give the same talk there tonight!
It's cold out here, but atleast the snow is now gone.
I walked 1.7km in 13m18s
📷 Avenue Gardens
🚩 Princess Road, London Borough of Brent, United Kingdom
📷 Leafy Entrance
🚩 East Heath Road, London Borough of Camden, United Kingdom
📷 From Green to Yellow.
🚩 St John's Wood Road, City of Westminster, United Kingdom
I walked 9.1km in 1h56m24s







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