std::time
Aus cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <ctime>
|
||
time_t time( std::time_t *time ); |
||
Gibt das aktuelle Kalenderjahr Zeit als std::time_t Objekt kodiert .
Original:
Returns the current calendar time encoded 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.
You can help to correct and verify the translation. Click here for instructions.
Inhaltsverzeichnis |
[Bearbeiten] Parameter
time | - | Zeiger auf ein Objekt std::time_t, um die Zeit in oder NULL speichern
Original: pointer to a std::time_t object to store the time in or NULL 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
Aktuelle Kalenderwoche Zeit als std::time_t Objekt auf Erfolg, (std::time_t)(-1) on error codiert. Wenn das Argument nicht NULL, wird der Rückgabewert auch das Objekt, auf die durch
time
gesetzt .Original:
Current calendar time encoded as std::time_t object on success, (std::time_t)(-1) on error. If the argument is not NULL, the return value is also set to the object pointed by
time
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Notes
Die Codierung der Kalenderzeit in std::time_t ist unbegrenzt, aber die meisten Systeme entsprechen POSIX specification und einen Wert zurückgeben integraler Typ, der die Anzahl der Sekunden seit der Epoche. Implementierungen, in denen std::time_t ist ein 32-Bit-Integer (viele historische Implementierungen) scheitern im Jahr 2038 .
Original:
The encoding of calendar time in std::time_t is unspecified, but most systems conform to POSIX specification and return a value of integral type holding the number of seconds since the Epoch. Implementations in which std::time_t is a 32-bit signed integer (many historical implementations) fail in the year 2038.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
#include <ctime> #include <iostream> int main() { std::time_t result = std::time(NULL); std::cout << std::asctime(std::localtime(&result)) << result << " seconds since the Epoch\n"; }
Output:
Wed Sep 21 10:27:52 2011 1316615272 seconds since the Epoch
[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) | |
wandelt Mal seit Epoche zu Kalenderzeit ausgedrückt als Universal Coordinated Time Original: converts time since epoch to calendar time expressed as Universal Coordinated Time The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (Funktion) | |
(C++11) |
Uhr, die die systemweite Echtzeituhr zur Verfügung stellt (Klasse) |
C documentation for time
|