My two cents to keep straying away from the original post.
New year in Britain was on March 25th, for a while.
My two cents to keep straying away from the original post.
New year in Britain was on March 25th, for a while.
@BB_UK also notice that leap year are those which are mod 4 == 0, but those which are mod 400 != 0 are not leap years. 1900 and 2100 are not leap years. I think this is one of the main points of Gregorian Calendar.
âNew year in Britain was on March 25th, for a while.â Their tax year now begins on April 6 because of their calendar change. Related topics: Microsoft Excel falsely pretends 1900 was a leap year. . And I hate times like 12:00 am or pm. We have perfectly good words ânoonâ and âmidnightâ so why not use them?
Did you notice the function in the above code:
logical function is_leap_year( year )
integer, intent(in) :: year
is_leap_year = (modulo(year,400)==0) .or. ((modulo(year,4)==0) .and. (modulo(year,100).ne.0))
return
end function is_leap_year
Since this expression only tests against 0, it works just as well using mod() as modulo().
No, I havenât noticed. My fault. Thanks
If you are working on a day-of-week function or subroutine, or are about to adopt a new one, here is something that may interest you:
Next year, 2026, there are three months in which Friday the 13th exists. The sum of the month numbers is 16 (if someone says âsixteenâ, I am tempted to say, âbless youâ), and the doomsday of 2026 is âSaturdayâ. In some cultures, Saturn is associated with a localized version of Satan.
From, the Web, I note:
"2015 was the last time this happened - it occurs in 1/7 of years, but not evenly spaced. (any common year where 1/1 is Thursday or leap year where 1/1 is Sunday; 2009 and 2012 both had it, but 2037 is the next occurrence after 2026.
It would seem that three Friday-13ths in a year is a more rare occurrence than eclipses! Here is a list of such years from 1900 onwards:
1903,
1914,
1925,1928,
1931,
1942
1953,1956,1959
1970
1981,1984,1987,
1998,
2009,2012,2015,
2026,
2037,
2040,2043
Here is my code for computing the weekday of a given day in the Gregorian calendar.
integer function dow(y,m,d)
integer, intent(in)::y,m,d
integer :: yy,cc,v,dm,e2
integer :: mc(12)=[3,0,0,4,2,6,4,1,5,3,0,5] !first dmsd of month,cmnY J.Conway
integer :: ml(12)=[4,1,0,4,2,6,4,1,5,3,0,5] !first dmsd of month, leapY J.Conway
logical :: leap
cc=int(y/100)
yy=mod(y,100)
if(yy.eq.0)then
leap=mod(y,400).eq.0
else
leap=mod(y,4).eq.0
endif
e2=mod(cc,4)+mod(yy,4)-1; dm=mod(5*e2+10*yy,7) !Nakai formula for doomsday of year
if(leap)then
v=d - ml(m) + dm
else
v=d - mc(m) + dm
endif
dow=mod(max(v,v+7),7)+1
return
end function dow
end program xdow
try running it for 1 January, AD 1 (the Gregorian Calendar was yet to be invented. The expected answer is 1, which signifies Monday.
If you use Gregorian dates before 1582, or before the Gergorian calendar was adopted somewhere locally, it is termed a âprolepticâ calendar. These are imaginary dates, âas ifâ the Gregorian calendar had been in effect then. Back when this day-of-the-week discussion first occurred here, I looked around to see what happens in the years -1, 0, and 1. In the Julian calendar that was used in Rome at the time, there were 365 days per year, but of course they did not use modern Christian-based year numbers. That is called the âAnno Dominiâ system, and it came later in 525 during the end of the Roman Empire in Europe. A flaw of this system is that there was no year 0, presumably because there was no 0 in the Roman number notation. There was a year 1BC (sort of like -1), and there was a year 1AD (year 1), but there was nothing in between. That means that modern day proleptic calendar dates are either off by one year for negative values, or that special effort must be expended to account for the missing year 0. Nowadays we use the terms CE (common era) and BCE (before common era) instead of AD and BC in order to avoid the religious references, but the CE and BCE dates still skip over year 0. Iâve always wondered why this wasnât corrected in modern times. When the CE/BCE convention was introduced in the 17th century (a century after the Gregorian Calendar) Arabic numerals that do have a 0 were in common use, so why didnât they fix the year 0 problem at the same time so that proleptic dates could be calculated in a straightforward way. Of course, matching proleptic dates with the contemporary calendar dates in previous eras will always require shifts and offsets (both years and days), but at least the proleptic dates would then be relatively simple to use and compute.
To put this in practical perspective, suppose Marty sets the date in the Delorean as November 13, 0000. What happens to him when he hits 88 mph?
Does anyone know if there is any modern day effort to fix this problem?
Marty goes to the year 1BC because Doc used the ISO-8601 standard that uses Astronomical years. Doc went back to Roman times to try and introduce a zero to their counting system so we could avoid the conundrum for all time, but they would have nothing to do with it.
I used ISO-8601 rules in GitHub - urbanjost/M_time: module of procedures that expand on the Fortran DATE_AND_TIME(3f) intrinsic, which is when I learned it had a zero year myself.