Message-Id: <199903191924.OAA04299@delorie.com> Comments: Authenticated sender is From: "George Foot" To: "Carlos M. Matos" Date: Fri, 19 Mar 1999 19:22:27 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: How do I get the time and date? CC: djgpp AT delorie DOT com X-mailer: Pegasus Mail for Win32 (v2.42a) Reply-To: djgpp AT delorie DOT com 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