Namensräume
Varianten
Aktionen

std::mktime

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

 
 
 
 
C-style Datum und Uhrzeit Versorgungsunternehmen
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Zeit Manipulation
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
Format Konvertierungen
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
Konstanten
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
 
Defined in header <ctime>
std::time_t mktime( std::tm* time );
Konvertiert lokalen Kalender auf eine Zeit, da Epoche als std::time_t Objekt, ignoriert die Werte time->tm_wday und time->yday. Die Werte der anderen Komponenten time nicht auf ihre üblichen Bereiche beschränkt. Ein negativer Wert von time->tm_isdst verursacht mktime zu versuchen, festzustellen, ob Daylight Saving Time in Kraft war .
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.
Wenn dies gelingt, berechnet und aktualisiert alle Felder in time an ihren richtigen Bereiche zu passen .
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.

Inhaltsverzeichnis

[Bearbeiten] Parameter

time -
Zeiger auf ein Objekt std::tm Angabe lokalen Kalender Zeit zu konvertieren
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.

[Bearbeiten] Rückgabewert

Zeit seit Epoche als std::time_t Objekt auf Erfolg oder -1 wenn time nicht als std::time_t Objekt dargestellt werden .
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.

[Bearbeiten] Beispiel

Zeigt die Zeit 100 Monaten
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

[Bearbeiten] Siehe auch

wandelt Mal seit Epoche Kalender Zeit ausgedrückt als lokale Zeit
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.

(Funktion) [edit]
C documentation for mktime