Namensräume
Varianten
Aktionen

std::asctime

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>
char* asctime( const std::tm* time_ptr );
Konvertiert bestimmten Kalenderjahr Zeit std::tm einer Textdarstellung .
Original:
Converts given calendar time std::tm to a textual representation.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Die resultierende Zeichenfolge hat folgendes Format:
Original:
The resulting string has the following format:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Www Mmm dd hh:mm:ss yyyy
  • Www - der Tag der Woche (eine Mon, Tue, Wed, Thu, Fri, Sat, Sun) .
    Original:
    Www - the day of the week (one of Mon, Tue, Wed, Thu, Fri, Sat, Sun).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • Mmm - der Monat (eine Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) .
    Original:
    Mmm - the month (one of Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec).
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • dd - der Tag des Monats
    Original:
    dd - the day of the month
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • hh - Stunden
    Original:
    hh - hours
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • mm - Minuten
    Original:
    mm - minutes
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • ss - Sekunden
    Original:
    ss - seconds
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • yyyy - Jahre
    Original:
    yyyy - years
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
Die Funktion unterstützt keine Lokalisierung .
Original:
The function does not support localization.
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_ptr -
Zeiger auf ein Objekt std::tm Spezifizieren der Zeit zu drucken
Original:
pointer to a std::tm object specifying the time to print
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

Zeiger auf einen statischen null-terminierte Zeichenkette Halten der textuelle Darstellung von Datum und Uhrzeit. Der String kann zwischen std::asctime und std::ctime geteilt werden, und können überschrieben werden bei jedem Aufruf einer dieser Funktionen .
Original:
Pointer to a static null-terminated character string holding the textual representation of date and time. The string may be shared between std::asctime and std::ctime, and may be overwritten on each invocation of any of those functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Notes

Diese Funktion gibt einen Zeiger auf statische Daten und ist nicht Thread-sicher. POSIX markiert diese Funktion obsolet und empfiehlt std::strftime statt .
Original:
This function returns a pointer to static data and is not thread-safe. POSIX marks this function obsolete and recommends std::strftime instead.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Das Verhalten ist undefiniert, wenn der Ausgabe-String wäre länger als 25 Zeichen, wenn timeptr->tm_wday oder timeptr->tm_mon nicht innerhalb der erwarteten Bereiche, oder wenn timeptr->tm_year übersteigt INT_MAX-1990 .
Original:
The behavior is undefined if the output string would be longer than 25 characters, if timeptr->tm_wday or timeptr->tm_mon are not within the expected ranges, or if timeptr->tm_year exceeds INT_MAX-1990.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Einige Implementierungen handhaben timeptr->tm_mday==0 dahin den letzten Tag des Vormonats .
Original:
Some implementations handle timeptr->tm_mday==0 as meaning the last day of the preceding month.
The text has been machine-translated via Google Translate.
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));
}

Output:

Tue Dec 27 16:45:52 2011

[Bearbeiten] Siehe auch

wandelt eine time_t Objekt eine textuelle Repräsentation
Original:
converts a time_t object to a textual representation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Funktion) [edit]
wandelt eine tm Objekt benutzerdefinierte textuelle Repräsentation
Original:
converts a tm object to custom textual representation
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++11)
Formate und gibt ein Datum / Zeit-Wert nach dem angegebenen Format
Original:
formats and outputs a date/time value according to the specified format
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]
C documentation for asctime