WCSFTIME(3)

NAME
wcsftime - convert date and time to a formatted wide-character string

SYNOPSIS

#include <time.h>

#include <wchar.h>

size_t wcsftime(wchar_t *s, size_t maxsize, const wchar_t *format, const struct tm *timp);

DESCRIPTION

wcsftime is equivalent to strftime, except that:

    • The argument s points to the initial element of an array of wide characters into which the generated output is to be placed.

    • The argument maxsize indicates the limiting number of wide characters.

    • The argument format is a wide-character string and the conversion specifiers are replaced by corresponding sequences of wide characters.

    • The return value indicates the number of wide characters.

(The difference in all of the above being wide characters versus regular characters.) See strftime for the details of the format specifiers.

RETURNS

When the formatted time takes up no more than maxsize 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 0, and the wide-character string starting at s corresponds to just those parts of *format that could be completely filled in within the maxsize limit.

PORTABILITY

C99 and POSIX require wcsftime, but do not specify the contents of *s when the formatted string would require more than maxsize characters. Unrecognized specifiers and fields of timp that are out of range cause undefined results. Since some formats expand to 0 bytes, it is wise to set *s to a nonzero value beforehand to distinguish between failure and an empty string. This implementation does not support s being NULL, nor overlapping s and format.

wcsftime requires no supporting OS subroutines.

SEE ALSO

strftime

AUTHORS

Steve Chamberlain
    Author.

Roland Pesch
    Author.

Red Hat Support

Jeff Johnston
    Author.

COPYRIGHT

This file documents the ANSI C library.

Copyright (C) 1992, 1993, 1994-2014 Red Hat, Inc.

libc includes software developed by the University of California, Berkeley and its contributors.

libc includes software developed by Martin Jackson, Graham Haley and Steve Chamberlain of Tadpole Technology and released to Cygnus.

libc uses floating-point conversion software developed at AT&T, which includes this copyright information:

The author of this software is David M. Gay.

Copyright (c) 1991 by AT&T.

Permission to use, copy, modify, and distribute this software for any purpose without fee is hereby granted, provided that this entire notice is included in all copies of any software which is or includes a copy or modification of this software and in all copies of the supporting documentation for such software.

THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.

Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, subject to the terms of the GNU General Public License, which includes the provision that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.