EmailDiscussions.com  

Go Back   EmailDiscussions.com > Miscellaneous > The Off-Topic Lounge
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Stay in touch wirelessly

The Off-Topic Lounge APPROPRIATE FAMILY-FRIENDLY TOPICS ONLY - READ THE RULES!
This forum is for posting anything (excluding topics prohibited by the forum rules) that's unrelated to email. General discussions, in other words.

Reply
 
Thread Tools
Old 24 Jun 2022, 03:58 AM   #1
Bamb0
Master of the @
 
Join Date: Feb 2005
Location: USA
Posts: 1,862
http://web.archive.org/web/200112180...20th_21st.html

This is quite interesting!!!!!
Bamb0 is offline   Reply With Quote

Old 24 Jun 2022, 05:09 AM   #2
hadaso
The "e" in e-mail
 
Join Date: Oct 2002
Location: Holon, Israel.
Posts: 4,801
What's interesting about a calendar?
hadaso is offline   Reply With Quote
Old 24 Jun 2022, 06:08 AM   #3
Bamb0
Master of the @
 
Join Date: Feb 2005
Location: USA
Posts: 1,862
Well its interesting seeing what years have the same days for example....

Like the year 2022 has the exact same day layout as

2005 2011 2033 2039 2050 2061 2067 2078 2089 and 2095
Bamb0 is offline   Reply With Quote
Old 24 Jun 2022, 08:16 AM   #4
hadaso
The "e" in e-mail
 
Join Date: Oct 2002
Location: Holon, Israel.
Posts: 4,801
That's simply because because there are 7 weekdays and every 4 years is a leap year (with February 29th), so you get a cycle of 28 years, so every 28 years you get the same layout. So what you have in 2022 you must also have in 2050 and in 2078 (but not in 2106 because actually there are also rules for leap years every 100 years and every 400 years so there's actually a cycle of 2800 years, though we probably would never complete a single cycle, and use star-dates long before the first cycle is over...).
Every leap year layout appears once in every 28 year cycle. Every regular year layout appears 3 times (for every weekday there's one regular year layout with it as January 1, and another such layout for a leap year). So the layout of 2022 has to appear 3 time between 2001 and 2028 (in 2005, 2011 and 2022).
In Fourmilab's calendar converter you can enter jan 1 of any year and see what weekday it is (or any other date) and also convert between many different calendars and read lots of information about how they work (including several private calendars of Microsoft that depend on various bugs in different versions of Excel: they excel in bugs!)
hadaso is offline   Reply With Quote
Old 24 Jun 2022, 02:22 PM   #5
somdcomputerguy
Cornerstone of the Community
 
Join Date: Jun 2004
Location: Rupert, WV
Posts: 876
I haven't made this script '$startYear changeable' other than just editing the file itself. I've written a few other PHP scripts, some useful but most both useless and useful..

- bruce

http://somdcomputerguy.com/leaps.php
PHP Code:
<? 
$startYear 
"1967";
$endYear   date("Y");
$leapYears = array();

echo 
"<center><h2>A list of leap years since $startYear</h2>";

for(
$i $startYear$i <= $endYear$i++){ if(($i == 0) and ($i 100 != 0) or ($i 400 == 0)){ $leapYears[] = $i; }}

foreach(
$leapYears as $leapyear){ echo "$leapyear<br>"; }

echo 
"<h3>So, there appears to have been " count($leapYears) . " leap years since $startYear.</h3>";

if(
$leapyear == $endYear){
    echo 
"<h4>This year is a leap year.</h4></center>";
    } else {
        echo 
"<h4>This year, <small>" date("Y") . "</small>, is not a leap year.</h4></center>";
    }
?>

Last edited by somdcomputerguy : 24 Jun 2022 at 02:41 PM. Reason: made code font size smaller
somdcomputerguy is offline   Reply With Quote
Old 25 Jun 2022, 11:04 PM   #6
hadaso
The "e" in e-mail
 
Join Date: Oct 2002
Location: Holon, Israel.
Posts: 4,801
Quote:
Originally Posted by hadaso View Post
... actually there are also rules for leap years every 100 years and every 400 years so there's actually a cycle of 2800 years, though we probably would never complete a single cycle, and use star-dates long before the first cycle is over...
Actually I was wrong here. My son corrected me when I told him about this 2800 thing. Since there is a one day shift in the first weekday each year, and an additional one day shift for each leap year, you get a 400+97=497 day shift in a 400 year cycle (since there are 97 leap years in a cycle). and since 497 days are exactly 71 weeks, the next 400 year cycle starts at exactly the same weekday. So we have only a 400 year cycle of calendars, not 2800, and since the first cycle started in 1582, it ended in 1982 and we are already 40 years into the second cycle.

Last edited by hadaso : 25 Jun 2022 at 11:06 PM. Reason: typo
hadaso is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +9. The time now is 10:04 PM.

 

Copyright EmailDiscussions.com 1998-2022. All Rights Reserved. Privacy Policy