Sunday 4 October 2015

programe to find date and time of system


 #include <time.h>
 #include <stdio.h> 
 
 
 
 
 
          int main(void)
 {
  time_t mytime;
  mytime = time(NULL);
  printf(ctime(&mytime));

  return 0;
 }
 
 
 
 
 
 
 
The string that is returned will have the following format:

 Www Mmm dd hh:mm:ss yyyy

 Www = which day of the week.
 Mmm = month in letters.
 dd = the day of the month.
 hh:mm:ss = the time in hour, minutes, seconds.
 yyyy = the year.

 Output example:
  Tue Feb 26 09:01:47 2009

Leave a Reply

 
 

Labels