home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / ctime.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-29  |  1.2 KB  |  64 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: ctime.c,v 1.1 1997/01/29 16:51:34 digulla Exp $
  4.  
  5.     Desc: Return the current time in seconds
  6.     Lang: english
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME */
  12. #include <time.h>
  13.  
  14.     char * ctime (
  15.  
  16. /*  SYNOPSIS */
  17.     const time_t * tt)
  18.  
  19. /*  FUNCTION
  20.     The ctime() function converts the broken-down time value tt
  21.     into a string with this format:
  22.  
  23.         "Wed Jun 30 21:49:08 1993\n"
  24.  
  25.     The return value points to a statically allocated string which
  26.     might be overwritten by subsequent calls to any of the date and
  27.     time functions.
  28.  
  29.     INPUTS
  30.     tt - Convert this time.
  31.  
  32.     RESULT
  33.     A statically allocated buffer with the converted time. Note that
  34.     there is a newline at the end of the buffer and that the contents
  35.     of the buffer might get lost with the call of any of the date
  36.     and time functions.
  37.  
  38.     NOTES
  39.  
  40.     EXAMPLE
  41.     time_t tt;
  42.     char * str;
  43.  
  44.     // Get time
  45.     time (&tt);
  46.  
  47.     // Convert to string
  48.     str = ctime (&tt);
  49.  
  50.     BUGS
  51.  
  52.     SEE ALSO
  53.     time(), asctime(), localtime()
  54.  
  55.     INTERNALS
  56.  
  57.     HISTORY
  58.     29.01.1997 digulla created
  59.  
  60. ******************************************************************************/
  61. {
  62.     return asctime (localtime (tt));
  63. } /* ctime */
  64.