Definition | #include <time.h> struct tm *gmtime(const time_t *sek_zg); struct tm *gmtime64(const time64_t *sek_zg);
Das größte darstellbare Datum ist bei
| |
Returnwert | Zeiger auf die berechnete Struktur. | |
| struct tm { int tm_sec; /* Sekunden (0-59) */ int tm_min; /* Minuten (0-59) */ int tm_hour; /* Stunden (0-23) */ int tm_mday; /* Tag des Monats (1-31) */ int tm_mon; /* Monate ab Jahresbeginn (0-11) */ int tm_year; /* Jahre seit 1900 */ int tm_wday; /* Wochentag (0-6, Sonntag=0) */ int tm_yday; /* Tage seit dem 1. Januar (0-365) */ int tm_isdst; /* Sommerzeitanzeige */ }; | |
| NULL | im Fehlerfall |
Hinweise | Die Funktionen | |
Beispiel | #include <time.h> #include <stdio.h> struct tm *t; char *s; time_t clk; int main(void) { clk = time((time_t *)0); t = gmtime(&clk); printf("Jahr: %d\n", t->tm_year + 1900); printf("Uhrzeit in Stunden: %d\n", t->tm_hour); printf("Jahrestag: %d\n", t->tm_yday); s = asctime(t); printf("%s", s); return 0; } | |
Siehe auch | asctime, ctime, ctime64, localtime, localtime64 |