std::put_time
Min standard notice:
Header: <iomanip>
When used in an expression out « put_time(tmb, fmt), converts the date and time information from a given calendar time tmb to a character string according to format string fmt, as if by calling std::strftime, std::wcsftime, or analog (depending on CharT), according to the std::time_put facet of the locale currently imbued in the output stream out.
# Declarations
template< class CharT >
/*unspecified*/ put_time( const std::tm* tmb, const CharT* fmt );
(since C++11)
# Parameters
tmb: pointer to the calendar time structure as obtained from std::localtime or std::gmtimefmt: pointer to a null-terminated CharT string specifying the format of conversion
# Return value
An object of unspecified type such that
# Example
#include <ctime>
#include <iomanip>
#include <iostream>
int main()
{
std::time_t t = std::time(nullptr);
std::tm tm = *std::localtime(&t);
std::cout.imbue(std::locale("ru_RU.utf8"));
std::cout << "ru_RU: " << std::put_time(&tm, "%c %Z") << '\n';
std::cout.imbue(std::locale("ja_JP.utf8"));
std::cout << "ja_JP: " << std::put_time(&tm, "%c %Z") << '\n';
}