---
name: "wcsftime"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/wcsftime"
---

# wcsftime(3)

convert date and time to a wide-character string

## NAME

**wcsftime**, **wcsftime\_l** – convert date and time to a wide-character string

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<wchar.h\>**

*size\_t*\

**wcsftime**(*wchar\_t \*restrict wcs*, *size\_t maxsize*, *const wchar\_t \*restrict format*, *const struct tm \*restrict timeptr*);

**#include \<wchar.h\>**

**#include \<xlocale.h\>**

*size\_t*\

**wcsftime\_l**(*wchar\_t \*restrict wcs*, *size\_t maxsize*, *const wchar\_t \*restrict format*, *const struct tm \*restrict timeptr*, *locale\_t loc*);

## DESCRIPTION

The **wcsftime**() function is equivalent to the **strftime**() function, except for the types of its arguments. Refer to [strftime(3)](/strftime/3.md) for a detailed description.

While the **wcsftime**() function uses the current locale, the **wcsftime\_l**() function may be passed a locale directly. See [xlocale(3)](/xlocale/3.md) for more information.

## COMPATIBILITY

Some early implementations of **wcsftime**() had a *format* argument with type *const char \**, instead of *const wchar\_t \**.

## SEE ALSO

[strftime(3)](/strftime/3.md), [xlocale(3)](/xlocale/3.md)

## STANDARDS

The **wcsftime**() function conforms to ISO/IEC 9899:1999 (“ISO C99”).
