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:

Member Avatar for iamthwee

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?

Time library?

Time Library.

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

Time library?

all the functions in time.h

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.

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

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 <time.h> are a much better bet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.