[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/chrono/c/localtime [Back]  [Original]

std::localtime cppreference.com
cppreference.com
Espaces de noms
Variantes

std::localtime

De cppreference.com
< cpp | chrono | c

<metanoindex/>

 
 
 
 
C-style utilitaires date et l'heure
Fonctions
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La manipulation du temps
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
Les conversions de format
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
Types
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
 
<tbody> </tbody>
Dclar dans l'en-tte <ctime>
std::tm* localtime( const std::time_t *time );
Convertit donn le temps depuis l'poque comme valeur std::time_t dans le temps calendaire, exprim en heure locale .
Original:
Converts given time since epoch as std::time_t value into calendar time, expressed in local time.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Paramtres

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.

Retourne la valeur

pointeur vers un objet std::tm statique interne en cas de succs, ou NULL autrement. La structure peut tre partag entre std::gmtime, std::localtime et std::ctime, et peut tre crase chaque appel .
Original:
pointer to a static internal std::tm object on success, or NULL otherwise. The structure may be 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.

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.
POSIX exige que cette fonction dfinit 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.

Exemple

#include <iostream>
#include <iomanip>
#include <ctime>

int main()
{
    std::time_t t = std::time(nullptr);
    std::cout << "UTC:   " << std::put_time(std::gmtime(&t), "%c %Z") << '\n'
              << "local: " << std::put_time(std::localtime(&t), "%c %Z") << '\n';
}

Rsultat :

UTC:   Wed Dec 28 11:47:03 2011 GMT
local: Wed Dec 28 06:47:03 2011 EST

Voir aussi

convertit le temps depuis l'poque de temps du calendrier exprime 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) [edit]
C documentation for localtime

Web Proxy Viewer  |  New URL  |  Original Page