<html>
<head>
  <title>asctime command</title>
  <meta name="Generator" content="GuideML V1.6">
  <meta http-equiv="Content-Type" content="text/html">
</head>
<body>
<a href="main.html">CONTENTS</a> | <a href="dice_index/main.html">INDEX</a> | <a href="main.html">PREV</a> | <a href="clock.html">NEXT</a>
<hr>
<pre>

 <b>asctime</b>

 NAME
  asctime - convert broken down time into standard text

 SYNOPSIS
  char *str = asctime(ts);
  const struct tm *ts;

 FUNCTION
  asctime() converts a broken down time in the tm structure to an
  ascii string and returns a pointer to that string.  The time
  string is formatted like this:

      Mon Dec 8 01:53:33 1987n0

  where n stands for a newline character and 0 is terminating
  nul.

  The string is stored in a static buffer shared by both asctime and
  ctime and so will get overwritten whenever either function is
  called.

 EXAMPLE
  /*
   *  since the string returned by asctime already has a newline on
   *  it we use fputs instead puts.
   */

  #include &#060;stdio.h&#062;
  #include &#060;time.h&#062;

  main()
  {
      time_t t = time(NULL);
      fputs(asctime(localtime(&amp;t)), stdout);
      return(0);
  }

 INPUTS
  struct tm *ts;  pointer to a broken down time structure

 RESULTS
  char *str;  pointer to static string

 SEE ALSO
  <a href="time.html">time</a>, <a href="localtime.html">localtime</a>, <a href="strftime.html">strftime</a>, <a href="ctime.html">ctime</a>, <a href="clock.html">clock</a>


</pre>
</body>
</html>
