给定年月日,要求把它转化为是一年中的第几天!
谢谢!
谢谢!
解决方案 »
- 兩個時間相減相加判斷?
- 帮帮我!UnRar.dll控件使用问题
- Rave 5.0中,如何在每一页都打印表尾
- 怎样把文件中的数据一行行读出来?
- Help!!!!!!!!!!!!!
- DevExpress cxDBPivotGrid 导出Excel 如何显示百分号
- 如何更新数据库中的每一条记录。sql语句如何写?
- 菜问题,希望给个回答
- TStaticText控件我想要把Caption显示在右下角怎么办?在线给分
- 我用Delphi+Asp+Xml+Word作了一个办公自动化Word文档网络编辑系统,具有签名和盖章功能,大家可以下载试用。
- 什么东西比贞操更宝贵(讨论者有分,只让给100,另开贴给分)
- 怎么获取和监控局域网络中的流量,以有效解决网络速度的问题
Label1.Caption:=inttostr(dayoftheyear(Date));
begin
Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));
end;function DayOfTheYear(Year: Word; Month: Word; Day: Word): Word;
var
I: Integer;
begin
Result := Day;
for I := 1 to Month - 1 do
begin
case I of
1, 3, 5, 7, 8, 10, 12: Inc(Result, 31); //大月31天
4, 6, 9, 11: Inc(Result, 30); //小月30天
2: Inc(Result, 28 + Ord(IsLeapYear(Year))); //平年28天,闰年多1天
end;
end;
end;