双立人平底锅氧化:delphi 怎样 取得 系统 月份

来源:百度文库 编辑:中科新闻网 时间:2024/05/06 16:54:47
为什么我使用 monthof() 系统认不到
实在是不好意思 加入单元是什么意思 谢谢
我才学

首先应加入单元 DateUtils ,然后就可以了。
eg:
在某一按钮中加入
var
i:word;
begin
i:=monthof(datetimepicker1.Date);
edit1.Text:=inttostr(i);

你太苯了,没人愿意回答你的问题的,这么简单的问题还问,自己去查API

我没用过Delphi,但用API肯定可以

GetSystemTime或者GetLocalTime

下面是MSDN中的资料:

The GetSystemTime function retrieves the current system date and time. The system time is expressed in Coordinated Universal Time (UTC).

void GetSystemTime(
LPSYSTEMTIME lpSystemTime
);

Parameters
lpSystemTime
[out] Pointer to a SYSTEMTIME structure to receive the current system date and time.

Return Values
This function does not return a value.

SYSTEMTIME

The SYSTEMTIME structure represents a date and time using individual members for the month, day, year, weekday, hour, minute, second, and millisecond.

typedef struct _SYSTEMTIME { WORD wYear; WORD wMonth; WORD wDayOfWeek; WORD wDay; WORD wHour; WORD wMinute; WORD wSecond; WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;
Members
wYear
Current year. The year must be greater than 1601.

Windows Server 2003, Windows XP: The year cannot be greater than 30827.

wMonth
Current month; January = 1, February = 2, and so on.
wDayOfWeek
Current day of the week; Sunday = 0, Monday = 1, and so on.
wDay
Current day of the month.
wHour
Current hour.
wMinute
Current minute.
wSecond
Current second.
wMilliseconds
Current millisecond.