Espaces de noms
Variantes
Affichages
Actions

std::chrono::time_point

De cppreference.com
< cpp‎ | chrono

 
 
 
 
std::chrono::time_point
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
time_point::time_point
time_point::time_since_epoch
time_point::operator+
time_point::operator-
time_point::min
time_point::max
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
common_type
operator+
operator-
operator==
operator!=
operator<
operator<=
operator>
operator>=
time_point_cast
 
Defined in header <chrono>
template<

    class Clock,
    class Duration = typename Clock::duration

> class time_point;
(depuis C++11)
std::chrono::time_point modèle de classe représente un point dans le temps. Il est mis en oeuvre comme si elle stocke une valeur de type Duration indiquant l'intervalle de temps depuis le début de l'époque de Clock .
Original:
Class template std::chrono::time_point represents a point in time. It is implemented as if it stores a value of type Duration indicating the time interval from the start of the Clock's epoch.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Sommaire

[modifier] Types de membres

Type du membre Définition
clock
Clock, l'horloge sur laquelle ce point le temps est mesuré
Original:
Clock, the clock on which this time point is measured
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
duration
Duration, un type std::chrono::duration utilisé pour mesurer le temps écoulé depuis l'époque
Original:
Duration, a std::chrono::duration type used to measure the time since epoch
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rep
Rep, un type de calcul qui représente le nombre de graduations de la durée
Original:
Rep, an arithmetic type representing the number of ticks of the duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
period
Period, un type std::ratio représentant la période tic-tac de la durée
Original:
Period, a std::ratio type representing the tick period of the duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifier] Fonctions membres

construit un point dans le temps nouveau
Original:
constructs a new time point
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
retourne le point de temps que la durée depuis le début de son horloge
Original:
returns the time point as duration since the start of its clock
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
modifie le point de temps de la durée donnée
Original:
modifies the time point by the given duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
retourne le point de temps correspondant à la plus petite durée
Original:
returns the time point corresponding to the smallest duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique statique) [edit]
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
returns the time point corresponding to the largest duration
(fonction membre publique statique) [edit]

[modifier] Fonctions annexes

se spécialise trait std::common_type
Original:
specializes the std::common_type trait
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe générique spécialisée) [edit]
modifie le point de temps de la durée donnée
Original:
modifies the time point by the given duration
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction générique) [edit]
compare deux points dans le temps
Original:
compares two time points
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction générique) [edit]
converts a time point to another time point on the same clock, with a different duration
(fonction générique) [edit]

[modifier] Exemple

Cet exemple affiche l'heure actuelle moins de 24 heures:
Original:
This example prints the current time minus 24 hours:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <iomanip>
#include <ctime>
#include <chrono>
 
int main()
{
    std::chrono::time_point<std::chrono::system_clock> now;
    now = std::chrono::system_clock::now();
    std::time_t now_c = std::chrono::system_clock::to_time_t(
                            now - std::chrono::hours(24));
    std::cout << "One day ago, the time was "
              << std::put_time(std::localtime(&now_c), "%F %T") << '\n';
}

Résultat possible :

One day ago, the time was 2011-10-25 12:00:08

[modifier] Voir aussi

(C++11)
un intervalle de temps
Original:
a time interval
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(classe générique)