35 pts.
 Abstract system date in C++
hi, iam rakesh a MCA student .iwant to abstract system date and time in my c++ project,what should be method for this .please give specific code.

Software/Hardware used:
ASKED: March 13, 2009  11:29 AM
UPDATED: March 13, 2009  2:51 PM

Answer Wiki:
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  carlosdl   63,580 pts.
All Answer Wiki Contributors:  carlosdl   63,580 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _