Espacios de nombres
Variantes
Acciones

std::ctime

De cppreference.com
< cpp‎ | chrono‎ | c

 
 
Utilidades de la biblioteca
Escriba apoyo (basic types, RTTI, type traits)
Gestión de memoria dinámica
Gestión de errores
Programa de servicios públicos
Funciones variadic
Fecha y hora
Objetos Function
initializer_list(C++11)
bitset
hash(C++11)
Operadores relacionales
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares y tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Cambiar, hacia adelante y mover
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
De lenguaje C de fecha y hora utilidades
Funciones
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tiempo de manipulación
Original:
Time manipulation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
difftime
time
clock
Conversiones de formato
Original:
Format conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asctime
ctime
strftime
wcsftime
gmtime
localtime
mktime
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
CLOCKS_PER_SEC
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tm
time_t
clock_t
 
Defined in header <ctime>
char* ctime( const std::time_t* time );
Convierte dado tiempo desde la época para un tiempo de calendario local y luego a una representación textual, como si se aplicase std::asctime(std::localtime(time)). La cadena resultante tiene el siguiente formato:
Original:
Converts given time since epoch to a calendar local time and then to a textual representation, as if by calling std::asctime(std::localtime(time)). The resulting string has the following format:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Www Mmm dd hh:mm:ss yyyy
  • Www - el día de la semana (uno de Mon, Tue, Wed, Thu, Fri, Sat, Sun) .
    Original:
    Www - the day of the week (one of Mon, Tue, Wed, Thu, Fri, Sat, Sun).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Mmm - el mes (una de Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) .
    Original:
    Mmm - the month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • dd - el día del mes
    Original:
    dd - the day of the month
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • hh - horas
    Original:
    hh - hours
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • mm - minutos
    Original:
    mm - minutes
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ss - segundos
    Original:
    ss - seconds
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • yyyy - años
    Original:
    yyyy - years
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
La función no es compatible con localización .
Original:
The function does not support localization.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Contenido

[editar] Parámetros

time -
puntero a un objeto std::time_t especificando el tiempo de imprimir
Original:
pointer to a std::time_t object specifying the time to print
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

Puntero a una cadena de caracteres terminada en cero estático celebración de la representación textual de fecha y hora. La cadena puede ser compartida entre std::asctime y std::ctime, y puede ser sobreescrita en cada invocación de cualquiera de estas funciones .
Original:
Pointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between std::asctime and std::ctime, and may be overwritten on each invocation of any of those functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Notas

Esta función devuelve un puntero a datos estáticos y no es seguro para subprocesos. Además, se modifica el objeto std::tm estática que puede ser compartida con std::gmtime y std::localtime. POSIX marca esta función obsoleta y recomienda std::strftime lugar .
Original:
This function returns a pointer to static data and is not thread-safe. In addition, it modifies the static std::tm object which may be shared with std::gmtime and std::localtime. POSIX marks this function obsolete and recommends std::strftime instead.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
El comportamiento puede ser definido por los valores de time_t que resultan en la cadena de más de 25 caracteres (por ejemplo, año 10000)
Original:
The behavior may be undefined for the values of time_t that result in the string longer than 25 characters (e.g. year 10000)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ejemplo

#include <ctime>
#include <iostream>
 
int main()
{
    std::time_t result = std::time(NULL);
    std::cout << std::ctime(&result);
}

Output:

Tue Dec 27 17:21:29 2011

[editar] Ver también

convierte un objeto tm a una representación textual
Original:
converts a tm object to a textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [edit]
convierte un objeto a la representación textual tm personalizado
Original:
converts a tm object to custom textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [edit]
(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.

(función de plantilla) [edit]
C documentation for ctime