如何取得当前年的时间! 找java进销存系统
财务软件版1楼: 如何取得当前年的时间!
如去年是2005年,得到:2005
今年是2006年,得到:2006
2007年,得到:2007
。。。
如去年是2005年,得到:2005
今年是2006年,得到:2006
2007年,得到:2007
。。。
2楼: Returns the year represented by a TDateTime value.
Unit
DateUtils
Category
datetime routines
Delphi syntax:
function YearOf(const AValue: TDateTime): Word;
C++ syntax:
extern PACKAGE Word __fastcall YearOf(const System::TDateTime AValue);
Description
Call YearOf to obtain the year represented by a specified TDateTime value. YearOf returns a value between 1 and 9999. 如java进销存系统
3楼: delphi中有一个yearofdatetime的函数(我记得不是很清楚了,你先查一下year这个关键字),delphi提供了很完整的时间函数的,甚至连当前天是今年的第几周都可以得到的。
4楼: formatdatetime(''yyyy'',now());
5楼: 学习
6楼: uses DateUtils;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
year:word;
begin
showmessage(floattostr(YearOf(now())));
end;
如果是數據庫msserver:
SELECT YEAR(GETDATE()) AS Expr1
财务软件版7楼: 学习
8楼: 多人接受答案了。