home *** CD-ROM | disk | FTP | other *** search
- /*
- (C) 1995-96 AROS - The Amiga Replacement OS
- $Id: asctime.c,v 1.1 1997/01/29 16:51:34 digulla Exp $
-
- Desc: Convert a time into a string.
- Lang: english
- */
-
- /*****************************************************************************
-
- NAME */
- #include <time.h>
-
- char * asctime (
-
- /* SYNOPSIS */
- const struct tm * tm)
-
- /* FUNCTION
- The asctime() function converts the broken-down time value tm
- into a string with this format:
-
- "Wed Jun 30 21:49:08 1993\n"
-
- The return value points to a statically allocated string which
- might be overwritten by subsequent calls to any of the date and
- time functions.
-
- INPUTS
- tm - The broken down time
-
- RESULT
- A statically allocated buffer with the converted time. Note that
- there is a newline at the end of the buffer and that the contents
- of the buffer might get lost with the call of any of the date
- and time functions.
-
- NOTES
-
- EXAMPLE
- time_t tt;
- struct tm * tm;
- char * str;
-
- // Get time
- time (&tt);
-
- // Break time up
- tm = localtime (&tt);
-
- // Convert to string
- str = asctime (tm);
-
- BUGS
-
- SEE ALSO
- time(), ctime(), localtime()
-
- INTERNALS
-
- HISTORY
- 29.01.1997 digulla created
-
- ******************************************************************************/
- {
- static char buffer[26];
-
- strftime (buffer, sizeof (buffer), "%C\n", tm);
-
- return buffer;
- } /* asctime */
-