how do I find out how many days between 2 days?

Discussion in 'C++' started by could.net@gmail.com, Nov 1, 2006.

  1. Guest

    I want to get these 2 values in c++ without using mfc:
    1. how many days between current date and 0001-1-1
    2. how many milliseconds elapsed since 00:00 of today.

    I would like to do this by only c++ or c runtime functions.

    Thanks in advance.
     
    , Nov 1, 2006
    #1
    1. Advertising

  2. wrote:
    > I want to get these 2 values in c++ without using mfc:
    > 1. how many days between current date and 0001-1-1
    > 2. how many milliseconds elapsed since 00:00 of today.
    >
    > I would like to do this by only c++ or c runtime functions.


    What's stopping you?
     
    Victor Bazarov, Nov 1, 2006
    #2
    1. Advertising

  3. Salt_Peter Guest

    wrote:
    > I want to get these 2 values in c++ without using mfc:
    > 1. how many days between current date and 0001-1-1
    > 2. how many milliseconds elapsed since 00:00 of today.
    >
    > I would like to do this by only c++ or c runtime functions.
    >
    > Thanks in advance.


    mfc is not C++ and it doesn't use C++ in any way either.

    Did you mean "how do I find out how many days between 2 _dates_ ?

    If so, how do you _store_ a date or time?
    After all, isn't that a requirement of the problem domain at hand?
     
    Salt_Peter, Nov 1, 2006
    #3
  4. Daniel T. Guest

    In article <>,
    wrote:

    > I want to get these 2 values in c++ without using mfc:
    > 1. how many days between current date and 0001-1-1
    > 2. how many milliseconds elapsed since 00:00 of today.
    >
    > I would like to do this by only c++ or c runtime functions.
    >
    > Thanks in advance.


    To do what you want, you need to investigate the functions available in
    the header <ctime>

    http://www.dinkumware.com/manuals/?manual=compleat&page=ctime.html

    --
    To send me email, put "sheltie" in the subject.
     
    Daniel T., Nov 1, 2006
    #4
  5. osmium Guest

    "Daniel T." writes:

    >> I want to get these 2 values in c++ without using mfc:
    >> 1. how many days between current date and 0001-1-1
    >> 2. how many milliseconds elapsed since 00:00 of today.
    >>
    >> I would like to do this by only c++ or c runtime functions.
    >>
    >> Thanks in advance.

    >
    > To do what you want, you need to investigate the functions available in
    > the header <ctime>
    >
    > http://www.dinkumware.com/manuals/?manual=compleat&page=ctime.html


    Sounds like a wild goose chase, especially WRT part 1. The stuff in ctime
    deals only with a very restricted set of dates.

    I suggest the OP look up Julian day number. *Not* to be confused with the
    Julian calendar.
     
    osmium, Nov 1, 2006
    #5
  6. Bo Yang Guest

    :
    > I want to get these 2 values in c++ without using mfc:
    > 1. how many days between current date and 0001-1-1
    > 2. how many milliseconds elapsed since 00:00 of today.
    >
    > I would like to do this by only c++ or c runtime functions.
    >

    I think you can take a look at the boost datetime library !

    > Thanks in advance.
    >
     
    Bo Yang, Nov 2, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Stockwell
    Replies:
    2
    Views:
    724
    Anna Martelli Ravenscroft
    Sep 20, 2004
  2. Gerrit
    Replies:
    0
    Views:
    408
    Gerrit
    Sep 20, 2004
  3. Li Chen
    Replies:
    2
    Views:
    129
    Li Chen
    Mar 4, 2010
  4. STD
    Replies:
    8
    Views:
    636
    Randal L. Schwartz
    Feb 26, 2012
  5. kirke

    list of days between two days

    kirke, Oct 19, 2006, in forum: Javascript
    Replies:
    7
    Views:
    153
    Julian Turner
    Oct 20, 2006
Loading...

Share This Page