std::time
De cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Déclaré dans l'en-tête <ctime>
|
||
time_t time( std::time_t *time ); |
||
Renvoie l'heure civile en cours codé comme un objet 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.
You can help to correct and verify the translation. Click here for instructions.
Sommaire |
[modifier] Paramètres
time | - | pointeur vers un objet std::time_t pour mémoriser l'heure 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. |
[modifier] Retourne la valeur
Temps calendaire actuelle codé comme objet std::time_t en cas de succès, (std::time_t)(-1) en cas d'erreur. Si l'argument n'est pas NULL, la valeur de retour est également mis à l'objet pointé par
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.
You can help to correct and verify the translation. Click here for instructions.
[modifier] Notes
L'encodage du temps calendaire dans std::time_t n'est pas spécifié, mais la plupart des systèmes sont conformes aux POSIX specification et renvoient une valeur de type entier en maintenant le nombre de secondes depuis l'Epoch. Implémentations dans lesquelles std::time_t est un 32-bit entier signé de nombreuses implémentations historiques () échouent dans l'année 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.
You can help to correct and verify the translation. Click here for instructions.
[modifier] Exemple
#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"; }
Résultat :
Wed Sep 21 10:27:52 2011 1316615272 seconds since the Epoch
[modifier] Voir aussi
convertit le temps depuis l'époque de temps du calendrier exprimée en heure locale 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. (fonction) | |
convertit le temps depuis l'époque de temps du calendrier exprimée en temps universel coordonné 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. (fonction) | |
(C++11) |
temps d'horloge à partir de la paroi de l'ensemble du système d'horloge en temps réel 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) |
C documentation for time
|