How do you not still need a calendar?.. You can calculate all you want from an epoch moment,
how do you then know the day of week, or if a date such as the 45th of June 1955 is invalid?
The calendar still counts from an epoch... you need to begin with a known leap year.
Hi Art;
The Epoch/Unix time ( 32 bits ) its valid since 1970 to 1938. Probably it will be changed to 64bits and then it will be valid longer than the age of the universe. ( Probably )
Several Industrial systems and Computer systems uses this aproach.
You don't need a calender for nothing, you can calculate everything from epoch time, including day of week, and also if a some date is valid or not.
By the way , to calculate day of week, or leap year you don't even need epoch time.
References;
Epoch/Unix time - https://en.wikipedia.org/wiki/Unix_time
Day of week calculation - https://en.wikipedia.org/wiki/Determ...ay_of_the_week
Calculating leap year. ( the algorith that i use ) You can find others;
if((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0))
{
isleapyear;
}
else
{
isnotleapyear;
}
Videos;
Thanks and Regards;
Gadelhas
This sounds like exactly what I did.. an maybe just that I call the code a calendar.
Except that I have a lookup table of leap years and start the algorithm from the closest to current.
Actually, thinking again, it might have been dates known to be a Monday on the first day.
Bookmarks