Espaços nominais
Variantes
Ações

std::time

De cppreference.com
< cpp | chrono | c

<metanoindex/>

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
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 e 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.
(C++11)
Troque, avançar e avançar
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.
(C++11)
(C++11)
(C++11)
 
 
C estilo de utilitários de data e hora
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Manipulação do tempo
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.
Conversões 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.
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.
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.
 
<tbody> </tbody>
Definido no cabeçalho <ctime>
time_t time( std::time_t *time );
Retorna a hora atual calendário codificado como um objeto std::time_t.
Original:
Returns the current calendar time encoded as a std::time_t object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parâmetros

time -
apontador para um objecto std::time_t para armazenar a hora ou NULL
Original:
pointer to a std::time_t object to store the time in or NULL
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

Tempo calendário atual codificado como objeto std::time_t em (std::time_t)(-1) sucesso, em caso de erro. Se o argumento não é NULL, o valor de retorno também está definido para o objeto apontado por time.
Original:
Current calendar time encoded as std::time_t object on success, (std::time_t)(-1) on error. If the argument is not NULL, the return value is also set to the object pointed by time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Notas

A codificação de tempo do calendário em std::time_t não é especificado, mas a maioria dos sistemas em conformidade com POSIX specification e retornar um valor de tipo integral mantendo o número de segundos desde a época. Implementações em que std::time_t é um 32-bit inteiros (muitas implementações históricos) falhar no ano de 2038.
Original:
The encoding of calendar time in std::time_t is unspecified, but most systems conform to POSIX specification and return a value of integral type holding the number of seconds since the Epoch. Implementations in which std::time_t is a 32-bit signed integer (many historical implementations) fail in the year 2038.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemplo

#include <ctime>
#include <iostream>

int main()
{
    std::time_t result = std::time(NULL);
    std::cout << std::asctime(std::localtime(&result))
              << result << " seconds since the Epoch\n";
}

Saída:

Wed Sep 21 10:27:52 2011
1316615272 seconds since the Epoch

Veja também

converte tempo desde a época de tempo do calendário expressa como hora local
Original:
converts time since epoch to calendar time expressed as local time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
converte tempo desde a época de tempo do calendário expressa como Tempo Universal Coordenado
Original:
converts time since epoch to calendar time expressed as Universal Coordinated Time
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(função) [edit]
tempo de relógio do relógio do sistema à escala em tempo real
Original:
wall clock time from the system-wide realtime clock
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe) [edit]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.