WCSFTIME(3P)

πŸ’– PROLOG πŸ’–

okay so bestie, real talk first: this page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (so like, go check the corresponding Linux manual page for the actual Linux tea β˜•), or honestly the interface may not even be implemented on Linux. We move regardless. πŸ’…


✨ NAME ✨

wcsftime β€” convert date and time to a wide-character string πŸ•βž‘οΈπŸŒΈ


πŸŽ€ SYNOPSIS πŸŽ€

#include <wchar.h>

size_t wcsftime(wchar_t *restrict wcs, size_t maxsize,
    const wchar_t *restrict format, const struct tm *restrict timeptr);

πŸ¦‹ DESCRIPTION πŸ¦‹

So the functionality on this reference page is aligned with the ISO C standard. If anything here conflicts with the ISO C standard, that conflict is unintentional β€” nobody meant it, it's not that deep. This volume of POSIX.1‐2017 defers to the ISO C standard. periodt.

wcsftime() shall be equivalent to the strftime() function, EXCEPT that (and this is the whole personality of the function, ok):

  • The argument wcs points to the initial element of an array of wide characters, and that's where the generated output goes.
  • The argument maxsize tells you the maximum number of wide characters to be placed in the output array. Like a little capacity limit. she has boundaries.
  • The argument format is a wide-character string, and the conversion specifications get replaced by corresponding sequences of wide characters. Now, it is unspecified whether an encoding error occurs if the format string contains wchar_t values that do not correspond to members of the character set of the current locale. (unspecified = we literally do not promise anything here, don't come for us 😭)
  • Field widths specify the number of wide characters instead of the number of bytes. character counts, not byte counts, bestie.
  • The return value indicates the number of wide characters placed in the output array.
⚠️ And if copying takes place between objects that overlap, the behavior is undefined. Like, do not do that. That's not a vibe, that's chaos. πŸ’€

πŸ’œ RETURN VALUE πŸ’œ

If the total number of resulting wide-character codes β€” and yes, that includes the terminating null wide-character code β€” is no more than maxsize, then wcsftime() shall return the number of wide-character codes placed into the array pointed to by wcs, not including the terminating null wide-character code. So like, the real count, minus the null. the null doesn't count, she's just there for moral support.

Otherwise? zero is returned, and the contents of the array are unspecified. 🫠 that's it. that's the answer. zero.


πŸ™ˆ ERRORS πŸ™ˆ

No errors are defined. literally none. icon behavior honestly.

The following sections are informative. (translation: the next few are bonus lore, not the main plot ✨)


πŸ“ EXAMPLES πŸ“

None.


🌈 APPLICATION USAGE 🌈

None.


🧚 RATIONALE 🧚

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • strftime()
  • The Base Definitions volume of POSIX.1‐2017, <wchar.h>

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


okay and that's the whole page bestie!! πŸ’…βœ¨ this diva was brought to you by IEEE/The Open Group, 2017, and it's the POSIX Programmer's Manual volume β€” WCSFTIME(3P) β€” mwah, go convert some timestamps, you ate. πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from