How can I get the system time , is it in time.h
is there a way to get the date
thanx
This is a discussion on system time within the C++ Programming forums, part of the General Programming Boards category; How can I get the system time , is it in time.h is there a way to get the date ...
How can I get the system time , is it in time.h
is there a way to get the date
thanx
> is it in time.h
like ctime() and strftime() perhaps
Most functions in the standard .h files have an associated manual page.
Reading a .h file, and skimming the manual pages would be a good idea. You won't remember the detail, but you will remember seeing something, and know roughly where to start looking for the detail when you next need it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Try this:
Code:#include <time.h> #include <stdio.h> void main( void ) { time_t ltime; time( <ime ); printf( "The time is %s\n", ctime( <ime ) ); }