Namespace
Varianti

std::chrono::time_point

Da cppreference.com.
< cpp‎ | chrono

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
 
std::chrono::time_point
Membri funzioni
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 membri funzioni
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;
(dal C++11)
Modello std::chrono::time_point classe rappresenta un punto nel tempo. È implementato come se si memorizza un valore di tipo Duration indica l'intervallo di tempo dall'inizio di epoca della Clock di.
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.

Indice

[modifica] Membri tipi

Membro tipo
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, l'orologio sul quale si misura tale punto temporale
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 tipo std::chrono::duration utilizzato per misurare il tempo trascorso epoca
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 tipo aritmetico che rappresenta il numero di segni di graduazione della durata
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 tipo che rappresenta il periodo std::ratio tick della durata
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.

[modifica] Membri funzioni

costruisce un nuovo punto di tempo
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.

(membro pubblico funzione) [edit]
restituisce il punto di tempo come durata dall'inizio del suo orologio
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.

(membro pubblico funzione) [edit]
modifica il punto di tempo dalla data durata
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.

(membro pubblico funzione) [edit]
[statico]
restituisce il punto di tempo corrispondente alla durata minima
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 membro funzione) [edit]
[statico]
returns the time point corresponding to the largest duration
(public static membro funzione) [edit]

[modifica] Non membri funzioni

specializzata il tratto 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 modello di specializzazione) [edit]
modifica il punto di tempo dalla data durata
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.

(funzione di modello) [edit]
confronta due punti temporali
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.

(funzione di modello) [edit]
converts a time point to another time point on the same clock, with a different duration
(funzione di modello) [edit]

[modifica] Esempio

Questo esempio visualizza l'ora attuale meno 24 ore:
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

[modifica] Vedi anche

(C++11)
un intervallo di tempo
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 template)