Namensräume
Varianten
Aktionen

std::chrono::time_point

Aus cppreference.com
< cpp‎ | chrono

 
 
 
 
std::chrono::time_point
Member-Funktionen
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
Non-Member-Funktionen
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;
(seit C++11)
Klassenvorlage std::chrono::time_point repräsentiert einen Punkt in der Zeit. Es angewendet wird, als ob es einen Wert des Typs Duration angibt das Zeitintervall vom Beginn des Clock der Epoche speichert .
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.

Inhaltsverzeichnis

[Bearbeiten] Mitglied Typen

Mitglied Typ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
clock
Clock, der Takt, auf dem dieser Zeitpunkt gemessen wird
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 ein std::chrono::duration Typ verwendet, um die Zeit seit Epoche messen
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, eine arithmetische Art, welche die Anzahl der Zecken von der Dauer
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 ein std::ratio Typ, der die Zecke Zeitraum der Dauer
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.

[Bearbeiten] Member-Funktionen

erstellt ein neues Zeitpunkt
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.

(öffentliche Elementfunktion) [edit]
gibt den Zeitpunkt als Dauer seit dem Beginn ihrer Uhr
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.

(öffentliche Elementfunktion) [edit]
modifiziert den Zeitpunkt von der gegebenen Dauer
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.

(öffentliche Elementfunktion) [edit]
[statisch]
gibt den Zeitpunkt entsprechend der kleinsten Dauer
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.

(public static Elementfunktion) [edit]
[statisch]
returns the time point corresponding to the largest duration
(public static Elementfunktion) [edit]

[Bearbeiten] Non-Member-Funktionen

spezialisiert die std::common_type Merkmal
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.

(class Template-Spezialisierung) [edit]
modifiziert den Zeitpunkt von der gegebenen Dauer
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.

(Funktions-Template) [edit]
vergleicht zwei Zeitpunkten
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.

(Funktions-Template) [edit]
converts a time point to another time point on the same clock, with a different duration
(Funktions-Template) [edit]

[Bearbeiten] Beispiel

Dieses Beispiel druckt die aktuelle Zeit minus 24 Stunden:
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';
}

Possible output:

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

[Bearbeiten] Siehe auch

(C++11)
ein Zeitintervall
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.

(Klassen-Template)