Upgraded GRUB2 to 2.00 release.
[AROS.git] / compiler / clib / asctime.c
blob390ac90c3dfc31738447d97f626789febbc39025
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Convert a time into a string.
6 */
8 /*****************************************************************************
10 NAME */
11 #include <time.h>
13 char * asctime (
15 /* SYNOPSIS */
16 const struct tm * tm)
18 /* FUNCTION
19 The asctime() function converts the broken-down time value tm
20 into a string.
22 See asctime_r() for details.
24 INPUTS
25 tm - The broken down time
27 RESULT
28 A statically allocated buffer with the converted time. Note that
29 the contents of the buffer might get lost with the call of any of the
30 date and time functions.
32 NOTES
33 This function must not be used in a shared library or
34 in a threaded application. Use asctime_r() instead.
36 EXAMPLE
37 time_t tt;
38 struct tm * tm;
39 char * str;
41 // Get time
42 time (&tt);
44 // Break time up
45 tm = localtime (&tt);
47 // Convert to string
48 str = asctime (tm);
50 BUGS
52 SEE ALSO
53 time(), ctime(), gmtime(), localtime()
55 INTERNALS
57 ******************************************************************************/
59 static char buffer[26];
61 asctime_r (tm, buffer);
63 return buffer;
64 } /* asctime */