std::gmtime
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>
|
||
std::tm* gmtime( const time_t* time ); |
||
Convertit donné le temps depuis l'époque comme valeur std::time_t dans le temps calendaire, exprimé en temps universel coordonné (UTC) .
Original:
Converts given time since epoch as std::time_t value into calendar time, expressed in Coordinated Universal Time (UTC).
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 time_t à convertir
Original: pointer to a time_t object to convert 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
Pointeur vers un objet std::tm statique interne en cas de succès, ou NULL autrement. La structure peut partagée entre std::gmtime, std::localtime et std::ctime et peut être écrasée à chaque appel .
Original:
Pointer to a static internal std::tm object on success, or NULL otherwise. The structure may shared between std::gmtime, std::localtime, and std::ctime and may be overwritten on each invocation.
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
Cette fonction peut ne pas être thread-safe .
Original:
This function may not be thread-safe.
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.
POSIX exige que cette fonction définit errno à EOVERFLOW si elle échoue parce que l'argument est trop grand .
Original:
POSIX requires that this function sets errno to EOVERFLOW if it fails because the argument is too large.
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 <iostream> #include <iomanip> #include <ctime> int main() { std::time_t t = std::time(NULL); std::cout << "UTC: " << std::put_time(std::gmtime(&t), "%c %Z") << '\n' << "local: " << std::put_time(std::localtime(&t), "%c %Z") << '\n'; }
Résultat :
UTC: Wed Dec 28 11:44:28 2011 GMT local: Wed Dec 28 06:44:28 2011 EST
[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) | |
C documentation for gmtime
|