1 /*
2 Copyright (c) 1994 Cygnus Support.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms are permitted
6 provided that the above copyright notice and this paragraph are
7 duplicated in all such forms and that any documentation,
8 and/or other materials related to such
9 distribution and use acknowledge that the software was developed
10 at Cygnus Support, Inc.  Cygnus Support, Inc. may not be used to
11 endorse or promote products derived from this software without
12 specific prior written permission.
13 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16  */
17 /*
18  * ctime.c
19  * Original Author:	G. Haley
20  */
21 
22 /*
23 FUNCTION
24 <<ctime>>---convert time to local and format as string
25 
26 INDEX
27 	ctime
28 INDEX
29 	ctime_r
30 
31 SYNOPSIS
32 	#include <time.h>
33 	char *ctime(const time_t *<[clock]>);
34 	char *ctime_r(const time_t *<[clock]>, char *<[buf]>);
35 
36 DESCRIPTION
37 Convert the time value at <[clock]> to local time (like <<localtime>>)
38 and format it into a string of the form
39 . Wed Jun 15 11:38:07 1988\n\0
40 (like <<asctime>>).
41 
42 RETURNS
43 A pointer to the string containing a formatted timestamp.
44 
45 PORTABILITY
46 ANSI C requires <<ctime>>.
47 
48 <<ctime>> requires no supporting OS subroutines.
49 */
50 
51 #include <time.h>
52 
53 #ifndef _REENT_ONLY
54 
55 char *
ctime(const time_t * tim_p)56 ctime (const time_t * tim_p)
57 {
58   return asctime (localtime (tim_p));
59 }
60 
61 #endif
62