Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>ctime</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ctime

Usage

   #include <time.h>
   char *ctime(time_t *ntime);

   ANSI

Description

   Converts the calender time (type time_t) pointed to by ntime to local
   time in the form of an ASCII string. It is equivalent to
   asctime(localtime(ntime));.The time_t value ntime is normally obtained by
   a call to the time function, obtaining time elapsed since 00:00:00 GMT on
   January 1, 1970.

Example 

   #include <time.h>
   #include <stdio.h>
   #include <stdlib.h>

   time_t ntime;

   int main()
   {
       time(&ntime);
       printf("The current time is %s\n",ctime(&ntime));
       return EXIT_SUCCESS;
   }

Return Value

   Returns pointer to a static ASCII string of 26 characters of the form:
   DDD MMM dd hh:mm:ss YYYY\n\0

   Where:

       DDD         =   day of the week
       MMM         =   month
       dd          =   day of the month
       hh:mm:ss    =   hour:minutes:seconds
       YYY         =   the year

   The string will be overwritten by each call to ctime.

See Also

   Time package, asctime, clock, difftime, localtime, time



See Also: time asctime clock difftime localtime time

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson