If you want to retrieve the current system date and time (and you are on a windows system), you could use the GetLocalTime function.
Here is an example:
<pre>SYSTEMTIME time;
GetLocalTime (&time);</pre>
The SYSTEMTIME structure represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond.
<pre>typedef struct _SYSTEMTIME { // st
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME; </pre>
Other option, that will work on non-windows systems is to use the functions from time.h
Example:
<pre>#include <time.h>
void main( int argc, char *argv[] )
{
time_t t;
time(&t);
...
...
}</pre>
Last Wiki Answer Submitted: March 13, 2009 2:51 pm by carlosdl63,580 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.