Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Система";
Текущий архив: 2002.01.10;
Скачать: [xml.tar.bz2];

Вниз

Clock and Date   Найти похожие ветки 

 
DenKost   (2001-09-27 20:45) [0]

Как програмно изменить системное время и дату.Заранее благодарен.


 
Alien   (2001-09-27 21:24) [1]

SetSystemTime


 
DenKost   (2001-09-28 01:01) [2]

А немножко поподробнее можно?


 
Alien   (2001-09-28 06:53) [3]

Help:
The SetSystemTime function sets the current system time and date. The system time is expressed in Coordinated Universal Time (UTC).

BOOL SetSystemTime(

CONST SYSTEMTIME *lpSystemTime // address of system time to set
);


Parameters

lpSystemTime

Points to a SYSTEMTIME structure that contains the current system date and time.
The wDayOfWeek member of the SYSTEMTIME structure is ignored.



Return Values

If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Windows NT: The SetSystemTime function fails if the calling process does not have the SE_SYSTEMTIME_NAME privilege. This privilege is disabled by default. Use the AdjustTokenPrivileges function to enable this privilege and again to disable it after the time has been set. For more information about security privileges, see Privileges.

Что ещё может быть подробнее?


 
Delphimun   (2001-09-28 13:04) [4]

Всё делается так:
//*************************************************************************
// Функция (раздел Public) SetPCSystemTime изменяет системную дату и время.
// Параметр(ы) : tDati Новая дата и время
// Возвращаемые значения: True - успешное завершение
// False - метод несработал
//*************************************************************************
function SetPCSystemTime(tDati: TDateTime): Boolean;
var

tSetDati: TDateTime;
vDatiBias: Variant;
tTZI: TTimeZoneInformation;
tST: TSystemTime;
begin

GetTimeZoneInformation(tTZI);
vDatiBias := tTZI.Bias / 1440;
tSetDati := tDati + vDatiBias;
with tST do
begin
wYear := StrToInt(FormatDateTime("yyyy", tSetDati));
wMonth := StrToInt(FormatDateTime("mm", tSetDati));
wDay := StrToInt(FormatDateTime("dd", tSetDati));
wHour := StrToInt(FormatDateTime("hh", tSetDati));
wMinute := StrToInt(FormatDateTime("nn", tSetDati));
wSecond := StrToInt(FormatDateTime("ss", tSetDati));
wMilliseconds := 0;
end;
SetPCSystemTime := SetSystemTime(tST);
end;


 
DenKost   (2001-09-28 15:05) [5]

Всем спасибо!



Страницы: 1 вся ветка

Форум: "Система";
Текущий архив: 2002.01.10;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.003 c
4-28559
Beka
2001-11-09 00:39
2002.01.10
как закрит поинтер миши внутри форми


1-28472
Delphig
2001-12-22 03:16
2002.01.10
Вот такая штука. Нужно чтобы при выборе в ListBox строчки....


14-28543
Anatoly Podgoretsky
2001-11-02 22:29
2002.01.10
Я в шоке 2


1-28495
dimonf
2001-12-22 21:49
2002.01.10
Ноаод, у меня вопрос как не выводит TPanel на ScrollBox?


1-28484
Русский
2001-12-21 21:54
2002.01.10
New заморочка от Русского ;)





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский