std::wcsftime
Min standard notice:
Header: <cwchar>
Converts the date and time information from a given calendar time time to a null-terminated wide character string str according to format string format. Up to count wide characters are written.
# Declarations
std::size_t wcsftime( wchar_t* str, std::size_t count, const wchar_t* format, const std::tm* time );
# Parameters
str: pointer to the first element of the wchar_t array for outputcount: maximum number of wide characters to writeformat: pointer to a null-terminated wide character string specifying the format of conversiontime: pointer to the date and time information to be converted
# Return value
Number of wide characters written into the wide character array pointed to by str not including the terminating L’\0’ on success. If count was reached before the entire string could be stored, 0 is returned and the contents are undefined.
# Example
#include <ctime>
#include <cwchar>
#include <iostream>
#include <locale>
int main()
{
std::locale::global(std::locale("ja_JP.utf8"));
std::time_t t = std::time(nullptr);
wchar_t wstr[100];
if (std::wcsftime(wstr, 100, L"%A %c", std::localtime(&t)))
std::wcout << wstr << '\n';
}