On Tuesday, February 20, 2018 at 5:45:36 PM UTC-6, Steven D'Aprano wrote: > On Tue, 20 Feb 2018 12:42:23 -0800, Rick Johnson wrote: > > > For instance, if the age is queried many times a second, > > it would be a much wiser design to set-up an event that > > will advance the age at the end of the last second of > > every year > > Do you really mean to say that everybody in the world has > their birthday on January 1st? We're not racehorses you > know.
No, silly rabbit. I was thinking about the problem from a _relative_ perspective, whereas you were thinking about the problem from a _global_ perspective. Neither perspective is wrong. If you read my exact words again: "a much wiser design to set-up an event that will advance the age at the end of the last second of every year" ...you'll notice that i mentioned no specific date. Therefore, "the last day of the year" (in relativistic terms) is 11:59:59PM on the calendar day which _precedes_ the day of the month for which you were born. So, for instance: if your birthday is January 25th 1969, the last second of the last day of your _first_ year is January 24th 1970 @ 11:59:59PM. And the last second of the last day of your _second_ year is January 24th 1971 @ 11:59:59PM. And so forth... Does this make sense? > > Under your scheme, 99.7% of records will return the wrong > age (off by one) at least once per year. Statistically, 50% > of queries will be wrong. Can you whip-up a small code example which proves your assertion? Hey, and feel free to include the seven dwarfs if you like. ;-) -- https://mail.python.org/mailman/listinfo/python-list