954,190 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Capture system date?

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:

ReDeViL
Newbie Poster
13 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

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?

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 
Time library?

Time Library.

Look into time() , asctime() , and related functions.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943
 
Time library?


all the functions in time.h

Ancient Dragon
Retired & Loving It
Team Colleague
30,046 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,342
 

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.

date d1;
getdate(&d1);
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.

johnpeter1989
Newbie Poster
7 posts since Nov 2006
Reputation Points: 11
Solved Threads: 1
 

thanks for the help!!!
i got it!!!

ReDeViL
Newbie Poster
13 posts since Oct 2006
Reputation Points: 10
Solved Threads: 0
 

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.

date d1;
getdate(&d1);
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 are a much better bet.

dwks
Posting Whiz in Training
269 posts since Nov 2005
Reputation Points: 185
Solved Threads: 28
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You