|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>wcsftime (The Red Hat newlib C Library)</title>
-
- <meta name="description" content="wcsftime (The Red Hat newlib C Library)">
- <meta name="keywords" content="wcsftime (The Red Hat newlib C Library)">
- <meta name="resource-type" content="document">
- <meta name="distribution" content="global">
- <meta name="Generator" content="makeinfo">
- <link href="index.html#Top" rel="start" title="Top">
- <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
- <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
- <link href="Wchar-strings.html#Wchar-strings" rel="up" title="Wchar strings">
- <link href="wcslcat.html#wcslcat" rel="next" title="wcslcat">
- <link href="wcscspn.html#wcscspn" rel="prev" title="wcscspn">
- <style type="text/css">
- <!--
- a.summary-letter {text-decoration: none}
- blockquote.indentedblock {margin-right: 0em}
- blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
- blockquote.smallquotation {font-size: smaller}
- div.display {margin-left: 3.2em}
- div.example {margin-left: 3.2em}
- div.lisp {margin-left: 3.2em}
- div.smalldisplay {margin-left: 3.2em}
- div.smallexample {margin-left: 3.2em}
- div.smalllisp {margin-left: 3.2em}
- kbd {font-style: oblique}
- pre.display {font-family: inherit}
- pre.format {font-family: inherit}
- pre.menu-comment {font-family: serif}
- pre.menu-preformatted {font-family: serif}
- pre.smalldisplay {font-family: inherit; font-size: smaller}
- pre.smallexample {font-size: smaller}
- pre.smallformat {font-family: inherit; font-size: smaller}
- pre.smalllisp {font-size: smaller}
- span.nolinebreak {white-space: nowrap}
- span.roman {font-family: initial; font-weight: normal}
- span.sansserif {font-family: sans-serif; font-weight: normal}
- ul.no-bullet {list-style: none}
- -->
- </style>
-
-
- </head>
-
- <body lang="en">
- <a name="wcsftime"></a>
- <div class="header">
- <p>
- Next: <a href="wcslcat.html#wcslcat" accesskey="n" rel="next">wcslcat</a>, Previous: <a href="wcscspn.html#wcscspn" accesskey="p" rel="prev">wcscspn</a>, Up: <a href="Wchar-strings.html#Wchar-strings" accesskey="u" rel="up">Wchar strings</a> [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
- </div>
- <hr>
- <a name="wcsftime_002d_002d_002dconvert-date-and-time-to-a-formatted-wide_002dcharacter-string"></a>
- <h3 class="section">6.14 <code>wcsftime</code>—convert date and time to a formatted wide-character string</h3>
- <a name="index-wcsftime"></a>
- <p><strong>Synopsis</strong>
- </p><div class="example">
- <pre class="example">#include <time.h>
- #include <wchar.h>
- size_t wcsftime(wchar_t *<var>s</var>, size_t <var>maxsize</var>,
- const wchar_t *<var>format</var>, const struct tm *<var>timp</var>);
-
- </pre></div>
- <p><strong>Description</strong><br>
- <code>wcsftime</code> is equivalent to <code>strftime</code>, except that:
- </p><ul>
- <li> The argument s points to the initial element of an array of wide characters
- into which the generated output is to be placed.
- </li><li> The argument maxsize indicates the limiting number of wide characters.
- </li><li> The argument format is a wide-character string and the conversion specifiers
- are replaced by corresponding sequences of wide characters.
- </li><li> The return value indicates the number of wide characters.
- </li></ul>
-
- <p>(The difference in all of the above being wide characters versus regular
- characters.)
- See <code>strftime</code> for the details of the format specifiers.
- </p>
- <br>
- <p><strong>Returns</strong><br>
- When the formatted time takes up no more than <var>maxsize</var> wide characters,
- the result is the length of the formatted wide string. Otherwise, if the
- formatting operation was abandoned due to lack of room, the result is
- <code>0</code>, and the wide-character string starting at <var>s</var> corresponds to just those
- parts of <code>*<var>format</var></code> that could be completely filled in within the
- <var>maxsize</var> limit.
- </p>
- <br>
- <p><strong>Portability</strong><br>
- C99 and POSIX require <code>wcsftime</code>, but do not specify the contents of
- <code>*<var>s</var></code> when the formatted string would require more than
- <var>maxsize</var> characters. Unrecognized specifiers and fields of
- <code>timp</code> that are out of range cause undefined results. Since some
- formats expand to 0 bytes, it is wise to set <code>*<var>s</var></code> to a nonzero
- value beforehand to distinguish between failure and an empty string.
- This implementation does not support <code>s</code> being NULL, nor overlapping
- <code>s</code> and <code>format</code>.
- </p>
- <p><code>wcsftime</code> requires no supporting OS subroutines.
- </p>
- <br>
- <p><strong>See Also</strong><br>
- <code>strftime</code>
- </p>
- <br>
-
- <hr>
- <div class="header">
- <p>
- Next: <a href="wcslcat.html#wcslcat" accesskey="n" rel="next">wcslcat</a>, Previous: <a href="wcscspn.html#wcscspn" accesskey="p" rel="prev">wcscspn</a>, Up: <a href="Wchar-strings.html#Wchar-strings" accesskey="u" rel="up">Wchar strings</a> [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
- </div>
-
-
-
- </body>
- </html>
|