Theiling Online    Sitemap    Conlang Mailing List HQ   

Programming a calendar system (WAS: Re: I Should've Been ...)

From:Carsten Becker <post@...>
Date:Sunday, April 25, 2004, 14:49
Hello!

Yay! Concalendaring ... I've got a question about manipulating the
calendar functions of programming languages, but first my concalendar,
then my problem:

456,25 days :: 18 months :: 25 1/3 days
>> 18*25,33333 = 456 days :: 0,25 days left per year
27 h/day :: 18 min/h :: 72 sec/min month | day/month :: month | days/month :: month | days/month ======|===========::=======|============::=======|=========== 01. | 25 :: 02. | 25 :: 03. | 25 04. | 25 :: 05. | 25 :: 06. | 25 07. | 24 :: 08. | 26 :: 09. | 30 10. | 26 :: 11. | 26 :: 12. | 24 13. | 25 :: 14. | 25 :: 15. | 25 16. | 25 :: 17. | 25 :: 18. | 25 = a total of 456 days average of 25,33333333 days/month -> fits! 9th month is the month where the leap day is in. Every 4th year has a leap day: -1 day. That's as if February would only have 27 days every four years. Now my question: How can you tell PHP to make this? The year has not 365 days but 456 days, that's the problem. If it's too much off-topic, we could discuss this off-list as well. Carsten ----- Original Message ----- From: "Iain E. Davis" <feaelin@...> Sent: Sunday, April 25, 2004 12:23 AM Subject: Re: I Should've Been Asleep Two Hours Ago...
> > From: David Peterson [mailto:ThatBlueCat@AOL.COM] > > > What would be even cooler is if someone who was math savvy > > could figure out how to manipulate the code so that it could > > be applied to different calendrical (?) systems. So, for > > ...different calendar systems... (I believe that's the way it would be > said.) > > > example, I thought that the concept of a week in Kamakawi > > should be 14 days instead of seven. The way the code is > > written now, I could only do seven days, but there should be > > a way to manipulate it so you could get 14. But even that > > should be easier than, say, a system where each week was > > composed of four days, or maybe each year was composed of > > five weeks. If there's anybody who knows how to do this kind > > of thing, I'd love to see it done. > > The first step down such a road is deciding how the calendar system
matches
> up (or doesn't, in many cases) a traditional calendar system. Calendar > systems that supposed to be for a world similar to ours are the
easiest
> (since they typically are a new arrangement of the 365-day year).
Identify
> the point where you can find a common event on both calendars, and
then work
> out the logic with a little math..for example the Falhaval used a
365-day
> calendar, which begins roughly around the same time as our March 1st.
So the
> first week on their calendar would be our Mar 1st to Mar 6th, the 2nd
week
> is 7 to 12th. I'd probably find it easiest to query the clock for the > "number of the day of the year" e.g., the number that will range from > 001-366, and then calculate from there which day, week, and month it
is.*
> > It becomes more tricky when working with a calendar that doesn't match
up
> precisely annually, then you have to pick an arbitrary point on our > calendar, and muck about with some tedious math dealing with working
it out
> from the "seconds since epoch" value that most machines rely on. Often
that
> value is the number of seconds since 1970-Jan-01, but not always. :).
I
> always considered using my birth date for this, but never got around
to
> actually writing any code to do it. :) > > * Although you'd have some nasty special cases dealing with 'did earth
have
> a leap year this year, and how does that skew our math?'

Replies

Roger Mills <rfmilly@...>
Mark J. Reed <markjreed@...>