Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > how do I find out how many days between 2 days?

Reply
Thread Tools

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

 
 
could.net@gmail.com
Guest
Posts: n/a
 
      11-01-2006
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.

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-01-2006
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?


 
Reply With Quote
 
 
 
 
Salt_Peter
Guest
Posts: n/a
 
      11-01-2006

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?

 
Reply With Quote
 
Daniel T.
Guest
Posts: n/a
 
      11-01-2006
In article <. com>,
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/?m...age=ctime.html

--
To send me email, put "sheltie" in the subject.
 
Reply With Quote
 
osmium
Guest
Posts: n/a
 
      11-01-2006
"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/?m...age=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.


 
Reply With Quote
 
Bo Yang
Guest
Posts: n/a
 
      11-02-2006
:
> 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.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
use file::find to find files modified in last 5 days STD Perl Misc 8 02-26-2012 06:52 PM
find days between two dates span different years Li Chen Ruby 2 03-04-2010 02:11 AM
list of days between two days kirke Javascript 7 10-20-2006 07:17 AM
Calculating days using Business Days for the Calendar David Stockwell Python 2 09-20-2004 09:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57