Results 1 to 8 of 8

Math Help - Formula

  1. #1
    Junior Member
    Joined
    Oct 2007
    Posts
    27

    Question 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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    10,211
    Thanks
    419
    Awards
    1
    Quote Originally Posted by MarianaA View Post
    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
    Follow Math Help Forum on Facebook and Google+

  3. #3
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by topsquark View Post
    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
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    10,211
    Thanks
    419
    Awards
    1
    Quote Originally Posted by Jhevon View Post
    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
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Oct 2007
    Posts
    27
    Quote Originally Posted by topsquark View Post
    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.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by topsquark View Post
    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
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    10,211
    Thanks
    419
    Awards
    1
    Quote Originally Posted by CaptainBlack View Post
    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
    Follow Math Help Forum on Facebook and Google+

  8. #8
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by CaptainBlack View Post
    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

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

    -Dan
    don't cry
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 4
    Last Post: July 15th 2011, 02:30 PM
  2. Replies: 8
    Last Post: September 5th 2010, 01:11 PM
  3. Replies: 1
    Last Post: April 26th 2010, 08:16 PM
  4. Velocity formula from a position formula
    Posted in the Calculus Forum
    Replies: 1
    Last Post: October 5th 2009, 03:50 PM
  5. Replies: 8
    Last Post: March 3rd 2009, 12:14 PM

Search Tags


/mathhelpforum @mathhelpforum