1<html lang="en"> 2<head> 3<title>asctime - Untitled</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Untitled"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Timefns.html#Timefns" title="Timefns"> 9<link rel="next" href="clock.html#clock" title="clock"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<meta http-equiv="Content-Style-Type" content="text/css"> 12<style type="text/css"><!-- 13 pre.display { font-family:inherit } 14 pre.format { font-family:inherit } 15 pre.smalldisplay { font-family:inherit; font-size:smaller } 16 pre.smallformat { font-family:inherit; font-size:smaller } 17 pre.smallexample { font-size:smaller } 18 pre.smalllisp { font-size:smaller } 19 span.sc { font-variant:small-caps } 20 span.roman { font-family:serif; font-weight:normal; } 21 span.sansserif { font-family:sans-serif; font-weight:normal; } 22--></style> 23<link rel="stylesheet" type="text/css" href="../cs.css"> 24</head> 25<body> 26<div class="node"> 27<a name="asctime"></a> 28<p> 29Next: <a rel="next" accesskey="n" href="clock.html#clock">clock</a>, 30Up: <a rel="up" accesskey="u" href="Timefns.html#Timefns">Timefns</a> 31<hr> 32</div> 33 34<h3 class="section">8.1 <code>asctime</code>—format time as string</h3> 35 36<p><a name="index-asctime-428"></a><a name="index-g_t_005fasctime_005fr-429"></a><strong>Synopsis</strong> 37<pre class="example"> #include <time.h> 38 char *asctime(const struct tm *<var>clock</var>); 39 char *_asctime_r(const struct tm *<var>clock</var>, char *<var>buf</var>); 40 41</pre> 42 <p><strong>Description</strong><br> 43Format the time value at <var>clock</var> into a string of the form 44<pre class="smallexample"> Wed Jun 15 11:38:07 1988\n\0 45</pre> 46 <p>The string is generated in a static buffer; each call to <code>asctime</code> 47overwrites the string generated by previous calls. 48 49 <p><br> 50<strong>Returns</strong><br> 51A pointer to the string containing a formatted timestamp. 52 53 <p><br> 54<strong>Portability</strong><br> 55ANSI C requires <code>asctime</code>. 56 57 <p><code>asctime</code> requires no supporting OS subroutines. 58 59 <p><br> 60 61 </body></html> 62 63