34 lines
866 B
Markdown
34 lines
866 B
Markdown
|
# FILETIME – Strukturreferenz (Windows API)
|
|||
|
|
|||
|
Die `FILETIME`-Struktur repräsentiert Zeitangaben im Windows-Dateisystem in einer 64-Bit-Darstellung.
|
|||
|
|
|||
|
## Definition (aus `WinBase.h`)
|
|||
|
|
|||
|
```c
|
|||
|
typedef struct _FILETIME {
|
|||
|
DWORD dwLowDateTime;
|
|||
|
DWORD dwHighDateTime;
|
|||
|
} FILETIME;
|
|||
|
```
|
|||
|
|
|||
|
## Beschreibung
|
|||
|
|
|||
|
- `FILETIME` speichert eine Zeit als Anzahl der 100-Nanosekunden-Intervalle seit dem 1. Januar 1601 (UTC).
|
|||
|
- Wird oft in Kombination mit `WIN32_FIND_DATA` oder `GetFileTime()` verwendet.
|
|||
|
|
|||
|
## Umwandlung in lesbare Zeit
|
|||
|
|
|||
|
```c
|
|||
|
FILETIME ft;
|
|||
|
// ...füllen durch API-Aufruf...
|
|||
|
|
|||
|
SYSTEMTIME st;
|
|||
|
FileTimeToSystemTime(&ft, &st);
|
|||
|
printf("%d-%02d-%02d %02d:%02d\n", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute);
|
|||
|
```
|
|||
|
|
|||
|
## Hinweise
|
|||
|
|
|||
|
- In lokalen Zeitzonen konvertieren: `FileTimeToLocalFileTime()`
|
|||
|
- Für High-Level-Zeitverarbeitung besser `SYSTEMTIME` oder `time_t` verwenden
|