How can we match the length of the Gregorian year and the length of the tropical year? - gregorian-calendar

At present the average length of the Gregorian Year over a period of 400 years is 365.2425 days, calculated as follows.
Average length of the Gregorian Year = (97 x 366 + 303 x 365)/ 400 = 365.2425 days
Since the length of the Tropical year is 365 days 5 hours 48 minutes 46 seconds that is, 365 + 20926/8640 = 365.24219907 days, due to which, there is a gap of 0.0003093 day per year, say 0.00031 day per year in them.

It is not at all difficult to bridge even this gap, by shedding one more leap year over a period of 3226 years, calculated in the following manner.
Supposing it has to be shed over N years — we can, very easily, calculate the value of N, as follows.
N = 1/0.00031 = 3225.8 years, say, 3226 years.
Since it has already covered 438 years since the year 1582 AD obviously, we can synchronise both years by shedding one more leap year over the next “3226 – 438” years, that is, by October 5, 4808.
I would recommend that the International Astronomical Society may take cognisance of this possibility.

Related

Aptitude, Why does 400 years have 0 odd years?

Q The last day of a century cannot be
Monday
Friday
Wednesday
Tuesday
Answer: Tuesday
Explanation:
100 years contain 5 odd days. ==> so Last day of 1st century is Friday.
200 years contain (5 x 2) 3 odd days. ==> So Last day of 2nd century is Wednesday.
300 years contain (5 x 3) = 15 1 odd day. ==> Last day of 3rd century is Monday.
400 years contain 0 odd day. ==> Last day of 4th century is Sunday.
This cycle is repeated.
So Last day of a century cannot be Tuesday or Thursday or Saturday.
Where I am stuck,
200 years have 5x2 = 10 extra days, so 10%7 = 2 odd days.
300 years have 5x3 = 15 extra days, so 15%7 = 1 odd days.
400 years should have 5x4 = 20 extra days, so 20%7 = 6 odd days.
But it say 0 odd days HOW and WHY??
You forgot that years numbered k*400 are leap years while k*400+100, k*400 +200, k*400+300 are not leap ones.
So 400 years give 20+1=21===0 mod 7 odd days
MBos answer is correct.
If I'm not mistaken, year 2000 is past for quite some while now, every year divisible by 400 and 1000 without some rest counts as NOT a leap year, contrary to the 400 year rule MBo mentioned.
The problem is: a year is actually 365.2425 long. To keep all discrepancies as low as possible, these kind of goofy rules exist to minimize errors.

girimi839y80904040mkrkellieimimdikiifirimKINOUBIGIAIIOVIubiuuiioioaa ufu Why do we saythat there 52 weeks in a year? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
Am I crazy, I've always thought there were 52 weeks in a year, a check on google returns numerous results stating the same...
But if I create a simple spreadsheet, with column A containing 1 to 365 and column B containing INT(A1 / 7) repeated 365 times, column B contains the week index corresponding to the 'julian' day in column A.
The weeks go from 0 to 52, this is actually 53 weeks. If the 1st of January is on day 0, then the 31st of December must overlay into week 1 of the next year.
Can some help explain why we say 52 weeks and not 53?
Sorry I know this isn't strictly a coding question, but is is very relative to a lot of problems with dates and coding.
There are 52 complete weeks in a year. The year has 365 days, leaving one extra day. A leap year has 366 days, adding a second extra day. This makes 52 1/7 weeks in a normal year and 52 2/7 weeks in a leap year..
An ISO week-numbering year (also called ISO year informally) has 52 or 53 full weeks, that is 364 or 371 days instead of the usual 365 or 366 days. The extra week is sometimes referred to as a leap week, although ISO 8601 does not use this term.
The ISO week date system is effectively a leap week calendar system that is part of the ISO 8601 date and time standard issued by the (ISO) since 1988 and, before that, it was defined in ISO (R) 2015 since 1971. It is used (mainly) in government and business for fiscal years, as well as in timekeeping. This was previously known as "Industrial date coding". The system specifies a week year atop the Gregorian calendar by defining a notation for ordinal weeks of the year.
Weeks start with Monday. Each week's year is the Gregorian year in which the Thursday falls. The first week of the year, hence, always contains 4 January. ISO week year numbering therefore slightly deviates from the Gregorian for some days close to 1 January.

Determine week number from date over several years

I'm looking for a way to determine the week number (week beginning on Monday) over several years. That means I don't want to have 0-53 but if, let's say I have 2 years of dates, I want them to be numbered with 0-106 in R.
I tried strftime(Datum, format ="%W") but then I only get the annual week number and not as a whole.
Given that you did not provide any data, I took the liberty of creating some:
#create data
Datum<-c("2013-03-01", "2014-06-02", "2013-06-01")
# format data to year-month-day with strptime
Datum<-strptime(Datum, "%Y-%m-%d")
You now need to identify the origin year. As I'm sure you are aware not all years have the same number of weeks 52.29 in a leap year vs. 52.4 in a standard calendar year but as this is unlikely to be a consideration for only 2 years we can use the number of weeks returned through the strftime function.
origin.year=as.numeric(min(substring(Datum,1,4)))
# number of weeks in first year (offset for second year)
n.weeks<-52
Now we can create a vector containing the number of weeks to offset each week in Datum (X).
X<-as.numeric(substring(Datum,1,4)!=origin.year)*n.weeks
We can then simply add this vector to the number of weeks returned by strftime when it is applied to Datum
week.vec<-as.numeric(strftime(Datum, "%W"))+X
This will work for 2 years, but if you have more years than this, you will need to modify the offsets to account for this.

Determine the number of days a bill range falls into two different date ranges

I am trying to calculate how many days a utility bill falls within two categories (date ranges).i.e. a bill range may be between 16/8/14 - 14/10/14 (total of 60 days incl) and I want to work out how many days fall in the 1/10/2014-31/3/15 season and how many days fall within the 1/4/14-30/9/14 season. It should be 14 and 46 but I am only getting 13 and 44. Any suggestions? thanks

Epidemiological curve using R and epitools gives wrong epiweeks

I have been trying to make epidemic curves in R with the epitools package. According to the documentation, you can automatically generate epidemiological weeks from a date variable, similar as I have been doing for long in STATA. Fyi, epidemiological weeks are different from yearly week numbers:
The first epi week of the year ends, by definition, on the first
Saturday of January, as long as it falls at least four days into the
month. Each epi week begins on a Sunday and ends on a Saturday.
http://www.cmmcp.org/epiweek.htm
https://wiki.ecdc.europa.eu/fem/f/1287/p/576/681.aspx#681
graphlabels<-epicurve.weeks(DATE_variable,
axisnames=FALSE,
xlab = "Week of Year",
ylab = "Cases per week",
tick.offset = 0.5,
col=mypalette)
axis(1,
at = graphlabels$xvals,
labels = graphlabels$cweek,
tick = FALSE,
line = 0,
)
This automatically generated a nice curve:
"Hurray!!", I thought. But, alas, being a scientist I double checked the data using STATA as well as manually and noticed that the data does not correspond!
Am I doing something wrong with epitool package that it gives me wrong epic weeks?
After some further discussion and research, there are differences in how epidemiological weeks can be calculated.
EPITOOLS as.week
In public health, reportable diseases are often reported by 'disease
week' (either week of reporting or week of symptom onset). In R, weeks
are numbered from 0 to 53 in the same year. The first day of week 1
starts with either the first Sunday or Monday of the year. Days before
week 1 are numbered as 0s. In contrast to R, the as.week function
generates weeks numbered from 1 to 53. The week before week 1 takes on
the value (52 or 53) from the last week of the previous year. The
as.week functions facilitates working with multiple years and
generating epidemic curves.
MMWR week
Values for MMWR week range from 1 to 53, although most years consist
of 52 weeks. The first day of any MMWR week is Sunday. MMWR week
numbering is sequential beginning with 1 and incrementing with each
week to a maximum of 52 or 53. MMWR week #1 of an MMWR year is the
first week of the year that has at least four days in the calendar
year. For example, if January 1 occurs on a Sunday, Monday, Tuesday or
Wednesday, the calendar week that includes January 1 would be MMWR
week #1. If January 1 occurs on a Thursday, Friday, or Saturday, the
calendar week that includes January 1 would be the last MMWR week of
the previous year (#52 or #53). Because of this rule, December 29, 30,
and 31 could potentially fall into MMWR week #1 of the following MMWR
year.
EPIWEEK for STATA
Each epidemiological week begins on a Sunday and ends on Saturday. And
the first epidemiological week of year ends on the first Saturday of
January, provided that it falls at least four or more days into the
month
ISO (or business) week
An ISO week-numbering year (also called ISO year informally) has 52 or
53 full weeks. That is 364 or 371 days instead of the usual 365 or 366
days. The extra week is referred to here as a leap week, although ISO
8601 does not use this term. Weeks start with Monday. The first week
of a year is the week that contains the first Thursday of the year
Week "u" in SAS
Each epidemiological week begins on a Sunday and ends on Saturday. And
the first epidemiological week of year contains Sunday. Weeks range
from 0 to 53 but do not always count 7 days

Resources