|
-
Jun 17th, 2001, 06:00 PM
#1
Thread Starter
transcendental analytic
Date algoritm
maybe this isn't the right forum for this, but it's my favourite forum so i decided to post here 
I need an algoritm to express a date format stored as a 32bit integer. In fact i need to express a date according to any planet with or without at least one moon. If there's no moons, month is omited and year and day is expressed. The time for the 32 bit integer is absolute. Currently i only know how to get year:
year= Time/Sunrot;Time%=Sunrot;
day=Time/Planetrot;
here's where i get stuck, the Planet rotates absolute to Time, but since the first day has to start with the first whole day I don't know where the day changes as original Time is erased. That would be nothing compared to the next problem, how do i put in the days on leapyears and how should i put in or remove extra leapyears?
Another qwestion, is there a reason to why each month is different length (on earth)?
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|