944,066 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 11023
  • C++ RSS
Nov 18th, 2006
0

Capture system date?

Expand Post »
Hi ppl!

can anyone tell me how to capture system date and o/p it later in a prog??

what function do i use??

thanks in advance! appreciate any help rendered. :cheesy:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ReDeViL is offline Offline
13 posts
since Oct 2006
Nov 18th, 2006
0

Re: Capture system date?

Click to Expand / Collapse  Quote originally posted by ReDeViL ...
Hi ppl!

can anyone tell me how to capture system date and o/p it later in a prog??

what function do i use??

thanks in advance! appreciate any help rendered. :cheesy:
Time library?
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Nov 18th, 2006
0

Re: Capture system date?

Click to Expand / Collapse  Quote originally posted by iamthwee ...
Time library?
Time Library.

Look into time(), asctime(), and related functions.
Moderator
Reputation Points: 3281
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,747 posts
since May 2006
Nov 18th, 2006
0

Re: Capture system date?

Click to Expand / Collapse  Quote originally posted by iamthwee ...
Time library?
all the functions in time.h
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,954 posts
since Aug 2005
Nov 19th, 2006
0

Re: Capture system date?

for dates, there is an inbuilt structure in dos.h

to get help in the cpp just get help on date

the date structure has just 3 items,day month and year.
there are in built functions to get current date
the following code will fill the structure item d1 with the current system date.

C++ Syntax (Toggle Plain Text)
  1.  
  2. date d1;
  3. getdate(&d1);
  4. cout<<d1.da_year<<d1.da_day<<d1.da_mon;//display date


to know more about each data item in struct date just get help from your cpp program.
Reputation Points: 11
Solved Threads: 1
Newbie Poster
johnpeter1989 is offline Offline
7 posts
since Nov 2006
Nov 22nd, 2006
0

Re: Capture system date?

thanks for the help!!!
i got it!!!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ReDeViL is offline Offline
13 posts
since Oct 2006
Nov 22nd, 2006
0

Re: Capture system date?

for dates, there is an inbuilt structure in dos.h

to get help in the cpp just get help on date

the date structure has just 3 items,day month and year.
there are in built functions to get current date
the following code will fill the structure item d1 with the current system date.

C++ Syntax (Toggle Plain Text)
  1.  
  2. date d1;
  3. getdate(&d1);
  4. cout<<d1.da_year<<d1.da_day<<d1.da_mon;//display date


to know more about each data item in struct date just get help from your cpp program.
Only very ancient compilers have dos.h. The ANSI-standard functions in <time.h> are a much better bet.
Reputation Points: 185
Solved Threads: 28
Posting Whiz in Training
dwks is offline Offline
269 posts
since Nov 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: help w/ problem
Next Thread in C++ Forum Timeline: [c++/visual studio 2003]Array Declaration Issue





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC