Capture system date?

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2006
Posts: 13
Reputation: ReDeViL is an unknown quantity at this point 
Solved Threads: 0
ReDeViL ReDeViL is offline Offline
Newbie Poster

Capture system date?

 
0
  #1
Nov 18th, 2006
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:
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Capture system date?

 
0
  #2
Nov 18th, 2006
Originally Posted by ReDeViL View 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:
Time library?
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 3,114
Reputation: WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of WaltP has much to be proud of 
Solved Threads: 281
Moderator
WaltP's Avatar
WaltP WaltP is offline Offline
Posting Sensei

Re: Capture system date?

 
0
  #3
Nov 18th, 2006
Originally Posted by iamthwee View Post
Time library?
Time Library.

Look into time(), asctime(), and related functions.
The 3 Laws of the Procrastination Society:
1) Never do today that which can be put off until tomorrow
2) Tomorrow never comes
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,412
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1469
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: Capture system date?

 
0
  #4
Nov 18th, 2006
Originally Posted by iamthwee View Post
Time library?
all the functions in time.h
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 7
Reputation: johnpeter1989 is an unknown quantity at this point 
Solved Threads: 1
johnpeter1989 johnpeter1989 is offline Offline
Newbie Poster

Re: Capture system date?

 
0
  #5
Nov 19th, 2006
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.

  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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: ReDeViL is an unknown quantity at this point 
Solved Threads: 0
ReDeViL ReDeViL is offline Offline
Newbie Poster

Re: Capture system date?

 
0
  #6
Nov 22nd, 2006
thanks for the help!!!
i got it!!!
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 251
Reputation: dwks has a spectacular aura about dwks has a spectacular aura about 
Solved Threads: 25
dwks's Avatar
dwks dwks is offline Offline
Posting Whiz in Training

Re: Capture system date?

 
0
  #7
Nov 22nd, 2006
Originally Posted by johnpeter1989 View Post
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.

  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.
dwk

Seek and ye shall find.

"Only those who will risk going too far can possibly find out how far one can go."
-- TS Eliot.

"I have not failed. I've just found 10,000 ways that won't work."
-- Thomas Alva Edison

"The only real mistake is the one from which we learn nothing."
-- John Powell
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC