Namespace
Varianti

std::mktime

Da cppreference.com.
< cpp‎ | chrono‎ | c

 
 
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)
 
 
C-stile di data e ora utilità
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tempo di manipolazione
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
Formato conversioni
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
Costanti
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
Tipi
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
 
Elemento definito nell'header <ctime>
std::time_t mktime( std::tm* time );
Converte l'ora locale del calendario a un tempo da un'epoca come oggetto std::time_t, ignorando i valori di time->tm_wday e time->yday. I valori delle altre componenti time non sono limitati al loro gamme abituali. Un valore negativo di time->tm_isdst provoca mktime tentare di determinare se l'ora legale era in vigore.
Original:
Converts local calendar time to a time since epoch as a std::time_t object, ignoring the values of time->tm_wday and time->yday. The values of other components of time are not restricted to their usual ranges. A negative value of time->tm_isdst causes mktime to attempt to determine if Daylight Saving Time was in effect.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
In caso di successo, ricalcola e aggiorna tutti i campi in time per soddisfare le loro gamme corretta.
Original:
If successful, recalculates and updates all fields in time to fit their proper ranges.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica] Parametri

time -
puntatore a un oggetto che specifica std::tm ora locale calendario da convertire
Original:
pointer to a std::tm object specifying local calendar time to convert
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Valore di ritorno

Tempo da epoca come un oggetto std::time_t in caso di successo o se -1 time non può essere rappresentato come un oggetto std::time_t.
Original:
Time since epoch as a std::time_t object on success or -1 if time cannot be represented as a std::time_t object.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica] Esempio

Visualizzare l'ora 100 mesi fa
Original:
Display the time 100 months ago
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>
 
int main()
{
    std::time_t t = std::time(NULL);
    std::tm tm = *std::localtime(&t);
    std::cout << "Today is           " << std::put_time(&tm, "%c %Z") <<'\n';
    tm.tm_mon -= 100;
    std::mktime(&tm);
    std::cout << "100 months ago was " << std::put_time(&tm, "%c %Z") << '\n';
}

Output:

Today is           Wed Dec 28 09:56:10 2011 EST
100 months ago was Thu Aug 28 10:56:10 2003 EDT

[modifica] Vedi anche

converte il tempo in quanto epoca di tempo del calendario espresso in ora 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.

(funzione) [modifica]
C documentation for mktime