std::time_put
De cppreference.com
|
|
Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate.
La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
| Definido en el archivo de encabezado <locale>
|
||
template< class CharT, class OutputIt = std::ostreambuf_iterator<CharT> > class time_put; |
||
Plantilla Clase
std::time_put encapsula las reglas de formato de fecha y hora. El manipulador std::put_time E / S utiliza la faceta std::time_put de la configuración regional del flujo de E / S para generar una representación de texto de un objeto std::tm .Original:
Class template
std::time_put encapsulates date and time formatting rules. The I/O manipulator std::put_time uses the std::time_put facet of the I/O stream's locale to generate text representation of an std::tm object.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Inheritance diagram
Tipo de requisitos
-OutputIt debe reunir los requerimientos de OutputIterator.
|
Especializaciones
Dos especializaciones y dos especializaciones parciales son proporcionados por la biblioteca estándar y son aplicadas por todos los objetos creados en un entorno nacional C + + programa:
Original:
Two specializations and two partial specializations are provided by the standard library and are implemented by all locale objects created in a C++ program:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Definido en el archivo de encabezado
<locale> | |
std::time_put<char>
|
crea representaciones estrechas de cadena de fecha y hora
Original: creates narrow string representations of date and time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::time_put<wchar_t>
|
crea representaciones de ancho de cadena de fecha y hora
Original: creates wide string representations of date and time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::time_put<char, OutputIt>
|
crea representaciones estrechas de cadena de fecha y hora utilizando iterador de salida personalizado
Original: creates narrow string representations of date and time using custom output iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
std::time_put<wchar_t, OutputIt>
|
crea representaciones de ancho de cadena de fecha y hora utilizando iterador de salida personalizado
Original: creates wide string representations of date and time using custom output iterator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Tipos de miembros
Miembro de tipo
Original: Member type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
char_type
|
CharT
|
iter_type
|
OutputIt
|
Las funciones miembro
| constructs a new time_put facet (función miembro pública) | |
destructs una faceta time_put Original: destructs a time_put facet The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro protegida) | |
Invoca do_put Original: invokes do_put The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro pública) |
Objetos miembros
static std::locale::id id |
Identificador de la configuración regional Original: id of the locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (objeto miembro público) |
Protegido funciones miembro
[virtual] |
formatos de fecha / hora y escribe a la corriente de salida Original: formats date/time and writes to output stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (función miembro virtual protegida de std::time_get)
|
Ejemplo
Ejecuta este código
#include <iostream>
#include <ctime>
#include <iomanip>
#include <codecvt>
int main()
{
std::time_t t = std::time(NULL);
std::wbuffer_convert<std::codecvt_utf8<wchar_t>> conv(std::cout.rdbuf());
std::wostream out(&conv);
out.imbue(std::locale("ja_JP"));
// this I/O manipulator std::put_time uses std::time_put<wchar_t>
out << std::put_time(std::localtime(&t), L"%A %c") << '\n';
}
Salida:
水曜日 2011年11月09日 12時32分05秒
Ver también
| Representa a std::time_put suministrado por el sistema para la configuración regional nombrada. (plantilla de clase) | |
Analiza valores de hora y fecha a partir de una secuencia de caracteres y los deposita en struct std::tm. (plantilla de clase) | |
(C++11) |
formatos y las salidas un valor de fecha / tiempo de acuerdo con el formato especificado Original: formats and outputs a date/time value according to the specified format The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (plantilla de función) |