定义一个_SYSTEMTIME类型的变量typedef struct _SYSTEMTIME { // st
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
MemberswYearSpecifies the current year. wMonthSpecifies the current month; January = 1, February = 2, and so on. wDayOfWeekSpecifies the current day of the week; Sunday = 0, Monday = 1, and so on. wDaySpecifies the current day of the month. wHourSpecifies the current hour. wMinuteSpecifies the current minute. wSecondSpecifies the current second. wMillisecondsSpecifies the current millisecond
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME;
MemberswYearSpecifies the current year. wMonthSpecifies the current month; January = 1, February = 2, and so on. wDayOfWeekSpecifies the current day of the week; Sunday = 0, Monday = 1, and so on. wDaySpecifies the current day of the month. wHourSpecifies the current hour. wMinuteSpecifies the current minute. wSecondSpecifies the current second. wMillisecondsSpecifies the current millisecond
解决方案 »
- 请问我用的是SPCOMM控件为什么发出命令后只收到一半的数据
- 请问为什么用WriteProcessMemory 对其它进程写入总是报错?
- 程序在其它电脑上运行提示没有找到borlndmm.dll(已去掉runtime)
- 如何将视图和表中的一些字段汇总后连接成一个表
- IT速查手册,程序员的维权基地
- 关于MDI背景的问题??
- 模拟实现ACDSee的SlideShow问题
- 关于Windows下的信使服务一问!
- 请教各位怎样在一个单元里调用另一个单元的变量?
- 困扰几个月的问题,有关Indy的TidTcpServer接收命令后显示窗口问题
- 用Delphi开发B/S中的Web多吗?
- delph5在win2000下开发的com在其他没有装delphi5的机器上无法注册
var
TempSystemTime:systemTime;
begin
TempSystemTime.wYear:=Year;
TempSystemTime.wMonth:=Month;
TempSystemTime.wDay:=Day;
with TempSystemTime do
DecodeTime(Time,wHour,wMinute,wSecond,wmilliSeconds);
setsystemTime(Tempsystemtime);
end;
修改当前日期
修改当前时间也类似
//修正日期、时间****************************************************************
//==============================================================================
procedure SetDateTime(DateTime: TDateTime);
var SystemTime: TSystemTime;
begin
DateTimeToSystemTime(DateTime,SystemTime);
SetLocalTime(SystemTime);
end;