Hi every one please
Can some one help me to find a formula to get how many days are between two dates.
For example: date1- November 07, 2007
date2- March 02, 1995.
Thanks.
There is no simple formula since the months pretty much have a random number of days to them.
I did once sit down and write an algorithm (not a formula) that would, for example, give me the day of the week when Christ was supposedly born. (He was born on a Thursday, the same day of the week as me!) If I can write such an algorithm I can't see why you couldn't write one to find the number of days between two dates.
I would start with the years: Find the difference in the number of years and you've got 365 days for each year. Then break it down into how many months and which months they are. etc.
-Dan
well, what date did you go back to? Dec 25th, 4B.C.? that is Christ's traditional birthday, but I think it's likely that that wasn't it. but that's not what matters, what matters is the algorithm!
how accurate did you get? did you account for leap years and things like that?
(I'm a day ahead of you, I was born on a Wednesday)
@MarianaA
remember the mnemonic: 30 days have September, April, June and November. All the rest have 31, except February, which has 28 days clear, and 29 in each leap year
Nah. I was literal and did December 25 in the year 0. (I know full well that it wasn't that date. And that's only if you believe He existed.)
I accounted for leap years and that extra day every 100 years that isn't a leap year. I think they've abandoned that one with the advent of the atomic clocks. They reset the clocks a little bit each year, or something, to account for that day.
Besides, I was using the Gregorian calendar (I think it's called that), which didn't exist until, what? 1500 or so?
-Dan