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

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

   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, January 1st
   1970  Greenwich  Mean  Time.  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>
   main()
   {
   time_t tclock;
        time(&tclock);
        printf("The current date and time: %s\n",
        asctime(localtime(&tclock)));
   }

   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

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