Re:Notes from MPUG: "Python one-liners" talk
by msluyter on Monday June 03, 2013 @05:32PM
(#5816166)
Interesting calendar trivia. The Gregorian calendar was adopted in Sept. 1752:
Britain and the British Empire (including the eastern part of what is now the United States) adopted the Gregorian calendar in 1752, by which time it was necessary to correct by 11 days. Wednesday, 2 September 1752 was followed by Thursday, 14 September 1752.
So, in this case, it looks like cal is doing the right thing.
Re:Notes from MPUG: "Python one-liners" talk
by dragonwriter on Monday June 03, 2013 @06:09PM
(#5816389)
The python version is using proleptic Gregorian and the cal version is using the historical calendar rules for a particular locale. Which is "right" depends on what you want.
Re:Notes from MPUG: "Python one-liners" talk
by ssorc on Monday June 03, 2013 @06:45PM
(#5816574)
cal works on most Unix systems, but is not part of Windows (is there a Powershell equivalent?)
If you don't have cygwin (or similar) installed, these types of one-liners have saved me a number of times for quick hacks on Windows systems.
EDIT: Actually this is pretty bad because python gets all the days of the week before September 1752 in North America wrong.
Britain and the British Empire (including the eastern part of what is now the United States) adopted the Gregorian calendar in 1752, by which time it was necessary to correct by 11 days. Wednesday, 2 September 1752 was followed by Thursday, 14 September 1752.
So, in this case, it looks like cal is doing the right thing.
https://bitbucket.org/densh/static-go