![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как получить текущую дату в обход стандартных функций Date & Now [D5, D6, Win95/98, WinME, NT4, Win2k, WinXP]
гончий © (2002-09-18 14:23:00)Например из даты создания файла реестра...Но тут непонятно, а будет ли работать это на разных операционках, как реализовать?
гончий (2002-09-18 14:33:00) [21]2 McSimm - угадал!
Алексей Ким (2002-09-18 14:33:00) [22]опять не то...
---
The GetFileTime function retrieves the date and time that a file was created, last accessed, and last modified.
BOOL GetFileTime(
HANDLE hFile, // identifies the file
LPFILETIME lpCreationTime, // address of creation time
LPFILETIME lpLastAccessTime, // address of last access time
LPFILETIME lpLastWriteTime // address of last write time
);
Parameters
hFile
Identifies the files for which to get dates and times. The file handle must have been created with GENERIC_READ access to the file.
lpCreationTime
Points to a FILETIME structure to receive the date and time the file was created. This parameter can be NULL if the application does not require this information.
lpLastAccessTime
Points to a FILETIME structure to receive the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or, in the case of executable files, run. This parameter can be NULL if the application does not require this information.
lpLastWriteTime
Points to a FILETIME structure to receive the date and time the file was last written to. This parameter can be NULL if the application does not require this information.
Return Value
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. To get extended error information, call GetLastError.
Remarks
The FAT, NTFS, and HPFS file systems all support the file creation, last access, and last write time values.
Windows 95: The precision of the time for a file in a FAT file system is 2 seconds. The time precision for files in other file systems, such as those connected through a network depends on the file system but may also be limited by the remote device.
See Also
FILETIME, GetFileSize, GetFileType, SetFileTime
прошу прощения за загрузку топика :(
REA (2002-09-18 14:31:00) [23]Как прочитать из RTC? :) Я уже спрашивал
Алексей Ким (2002-09-18 14:30:00) [24]не... не то нажал...
---
The GetSystemTimeAsFileTime function obtains the current system date and time. The information is in Coordinated Universal Time (UTC) format.
VOID GetSystemTimeAsFileTime(
LPFILETIME lpSystemTimeAsFileTime // pointer to a file time structure
);
Parameters
lpSystemTimeAsFileTime
Pointer to a FILETIME structure to receive the current system date and time in UTC format.
Return Value
This function does not return a value.
Remarks
The GetSystemTimeAsFileTime function is equivalent to the following code sequence:
FILETIME ft;
SYSTEMTIME st;
GetSystemTime(&st);
SystemTimeToFileTime(&st,&ft);
Windows 95: The GetSystemTimeAsFileTime function is not available on the Windows 95 platform. If you need its functionality, use the preceding code sequence.
See Also
FILETIME, GetSystemTime, SYSTEMTIME, SystemTimeToFileTime
Слесарь Матерящийся (2002-09-18 14:29:00) [25]Прочитать из RTC.
McSimm (2002-09-18 14:27:00) [26]Попытаюсь угадать - обманываем хакеров? :)
Алексей Ким (2002-09-18 14:26:00) [27]из win32.hlp
---
The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).
VOID GetSystemTime(
LPSYSTEMTIME lpSystemTime // address of system time structure
);
Parameters
lpSystemTime
Points to a SYSTEMTIME structure to receive the current system date and time.
Return Value
This function does not return a value.
Remarks
Windows 95: Early beta implementations of this function return local time rather than UTC.
See Also
GetLocalTime, GetSystemTimeAdjustment, SetSystemTime, SYSTEMTIME
REA (2002-09-18 14:25:00) [28]Чем функции то не угодили?