Mail Archives: djgpp/1999/03/19/14:25:07.2
On 19 Mar 99 at 6:06, Carlos M. Matos wrote:
> Hi!
>
> First of all let me thank you in advance for all of you who will respond to
> this message. Thanks to all of you.
>
> I am writting a program in C++ using djgpp version 2.02. I need to know how
> to get the time and the date from
> the system. I am writting a checking account program which keeps track of
> the time and date when a checking transaction has been done. I will be
> waiting for your response. I have a dead line to turn in this program by
> this comming monday March 29, 1999 and today is Friday, March 19, 1999.
> Once again thank you for your responce.
This isn't really a djgpp question, it's a general language
question. I don't know about C++, but in C you'd use `gmtime'
or `localtime' to convert the value returned by `time' to a
readable format. Here's a copy of the example from the
documentation of `gmtime':
time_t x;
struct tm *t;
time(&x);
t = gmtime(&t);
On the other hand, if you just want an ASCII representation of
the time, look up `ctime' and `asctime'.
--
George
- Raw text -