# Thread: Formula

1. ## Formula

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.

2. Originally Posted by MarianaA
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

3. Originally Posted by topsquark
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.
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

4. Originally Posted by Jhevon
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)
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

5. Originally Posted by topsquark
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
Ok, thanks, I am going to try.

6. Originally Posted by topsquark
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.)
There is no year zero, the calendar goes straight from 1 BCE to 1 CE.

RonL

7. Originally Posted by CaptainBlack
There is no year zero, the calendar goes straight from 1 BCE to 1 CE.

RonL
I'm going to point my finger and jump up and down and cry, just because you said that.

-Dan

8. Originally Posted by CaptainBlack
There is no year zero, the calendar goes straight from 1 BCE to 1 CE.

RonL
i thought that sounded weird when i saw topsquark say year 0, but i just shook it off, "he's smarter than me, he'd know if there was actually such a thing as year 0 or not." guess not

Originally Posted by topsquark
I'm going to point my finger and jump up and down and cry, just because you said that.

-Dan
don't cry