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>asctime</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
asctime

Usage

   #include <time.h>
   char *asctime(struct tm *ntime);

   ANSI

Description

   asctime converts a time structure into an ASCII string of 26 characters
   including the null having the form of:

       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
       YYYY        =   year

   The usual method of obtaining the time is to first call the time function
   to get the number of seconds elapsed since 00:00:00 GMT on January 1,
   1970. This is passed as an argument to the localtime function which
   returns a pointer to the structure tm as defined in time.h. This is then
   used as the ntime argument to asctime.

Example 

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

   int main()
   {
       time_t tclock;
       time(&tclock);
       printf("The current date and time: %s\n",

           asctime(localtime(&tclock)));
       return EXIT_SUCCESS;
   }

Return Value

   Returns a pointer to a character string containing the date and time. The
   string is static and is overwritten with each call to asctime.

See Also

   Time package, clock, ctime, difftime, localtime


See Also: clock ctime difftime localtime

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