std::time_get
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 InputIt = std::istreambuf_iterator<CharT> > class time_get; |
||
Plantilla Clase
std::time_get encapsula las reglas de fecha y hora de análisis. El manipulador std::get_time E / S utiliza la faceta std::time_get de la configuración regional del flujo de E / S para convertir la entrada de texto a un objeto std::tm .Original:
Class template
std::time_get encapsulates date and time parsing rules. The I/O manipulator std::get_time uses the std::time_get facet of the I/O stream's locale to convert text input to a 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
-InputIt debe reunir los requerimientos de InputIterator.
|
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_get<char>
|
analiza las representaciones estrechas cadena de fecha y hora
Original: parses 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_get<wchar_t>
|
analiza las representaciones de ancho de cadena de fecha y hora
Original: parses 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_get<char, InputIt>
|
analiza las representaciones estrechas cadena de fecha y hora utilizando iterador de entrada personalizado
Original: parses narrow string representations of date and time using custom input 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_get<wchar_t, InputIt>
|
analiza las representaciones de ancho de cadena de fecha y hora utilizando iterador de entrada personalizado
Original: parses wide string representations of date and time using custom input 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
|
InputIt
|
Las funciones miembro
construye una nueva faceta time_get Original: constructs a new time_get 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 pública) | |
destructs una faceta time_get Original: destructs a time_get 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_date_order Original: invokes do_date_order 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) | |
Invoca do_get_time Original: invokes do_get_time 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) | |
Invoca do_get_date Original: invokes do_get_date 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) | |
Invoca do_get_weekday Original: invokes do_get_weekday 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) | |
Invoca do_get_monthname Original: invokes do_get_monthname 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) | |
Invoca do_get_year Original: invokes do_get_year 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) | |
Invoca do_get Original: invokes do_get 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] |
obtiene preferido orden de día, mes y año Original: obtains preferred ordering of day, month, and year 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) |
[virtual] |
extractos de horas, minutos y segundos de flujo de entrada Original: extracts hours, minutes, and seconds from input 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) |
[virtual] |
extractos de mes, día y año de la corriente de entrada Original: extracts month, day, and year from input 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) |
[virtual] |
extracts the name of a day of the week from input stream (función miembro virtual protegida) |
[virtual] |
extacts un nombre de mes de la corriente de entrada Original: extacts a month name from input 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) |
[virtual] |
extrae un año a partir de flujo de entrada Original: extracts a year from input 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) |
[virtual] |
extrae los componentes de fecha / hora de flujo de entrada, de acuerdo con el formato especificado Original: extracts date/time components from input stream, 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. (función miembro virtual protegida) |
Heredado de std::time_base
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
dateorder
|
orden de fecha de tipo de enumeración, definición de los valores
no_order, dmy, mdy, ymd y ydmOriginal: date order enumeration type, defining the values no_order, dmy, mdy, ymd, and ydmThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Ejemplo
Ejecuta este código
#include <iostream>
#include <sstream>
#include <string>
#include <locale>
#include <ctime>
#include <iomanip>
int main()
{
std::wstring input = L"2011-Februar-18 23:12:34";
std::tm t;
std::wistringstream ss(input);
ss.imbue(std::locale("de_DE"));
ss >> std::get_time(&t, L"%Y-%b-%d %H:%M:%S"); // uses std::time_get<wchar_t>
std::cout << std::asctime(&t);
}
Salida:
Sun Feb 18 23:12:34 2011
Ver también
formatos de contenido de struct std::tm para la salida como secuencia de caracteresOriginal: formats contents of struct std::tm for output as character sequenceThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (plantilla de clase) | |
(C++11) |
analiza un valor de fecha / hora de formato especificado Original: parses a date/time value of 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) |