blob: 5c6e4e0135ba85f2c2dcc99e8ed58cd7bfbad6be [file]
<html lang="en">
<head>
<title>ctime - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Timefns.html#Timefns" title="Timefns">
<link rel="prev" href="clock.html#clock" title="clock">
<link rel="next" href="difftime.html#difftime" title="difftime">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="ctime"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="difftime.html#difftime">difftime</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="clock.html#clock">clock</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Timefns.html#Timefns">Timefns</a>
<hr>
</div>
<h3 class="section">8.3 <code>ctime</code>&mdash;convert time to local and format as string</h3>
<p><a name="index-ctime-431"></a><a name="index-ctime_005fr-432"></a><strong>Synopsis</strong>
<pre class="example"> #include &lt;time.h&gt;
char *ctime(const time_t *<var>clock</var>);
char *ctime_r(const time_t *<var>clock</var>, char *<var>buf</var>);
</pre>
<p><strong>Description</strong><br>
Convert the time value at <var>clock</var> to local time (like <code>localtime</code>)
and format it into a string of the form
<pre class="smallexample"> Wed Jun 15 11:38:07 1988\n\0
</pre>
<p>(like <code>asctime</code>).
<p><br>
<strong>Returns</strong><br>
A pointer to the string containing a formatted timestamp.
<p><br>
<strong>Portability</strong><br>
ANSI C requires <code>ctime</code>.
<p><code>ctime</code> requires no supporting OS subroutines.
<p><br>
</body></html>