請問如何判斷某個月的最後一天是幾號呢? |
答題得分者是:max5020
|
blantt
一般會員 發表:15 回覆:17 積分:6 註冊:2006-08-30 發送簡訊給我 |
|
Fishman
尊榮會員 發表:120 回覆:1949 積分:2163 註冊:2006-10-28 發送簡訊給我 |
DaysInAMonth function
Returns the number of days in a specified month of a specified year. Unit DateUtils Category date/time routines function DaysInAMonth(const AYear, AMonth: Word): Word; Description Call DaysInAMonth to obtain the number of days in the specified month of the specified year. AYear is a year between 1 and 9999 (inclusive). AMonth is a month between 1 and 12 (inclusive). Fishman
------
Fishman |
max5020
資深會員 發表:30 回覆:277 積分:321 註冊:2003-06-04 發送簡訊給我 |
function BeginOfMonth(const xDat:TDateTime): TDateTime;
var AYear, AMonth, Aday:Word; begin DecodeDate(xDat, AYear, AMonth, ADay); Result:= EncodeDate(AYear, AMonth, 1); end; function EndOfMonth(const xDat:TDateTime): TDateTime; var vdat:TDateTime; begin vdat:= BeginOfMonth(xdat) 31; Result:= BeginOfMonth(vdat)- 1; end; |
max5020
資深會員 發表:30 回覆:277 積分:321 註冊:2003-06-04 發送簡訊給我 |
function BeginOfMonth(const xDat:TDateTime): TDateTime;
var AYear, AMonth, Aday:Word; begin DecodeDate(xDat, AYear, AMonth, ADay); Result:= EncodeDate(AYear, AMonth, 1); end; function EndOfMonth(const xDat:TDateTime): TDateTime; var vdat:TDateTime; begin vdat:= BeginOfMonth(xdat) 31; Result:= BeginOfMonth(vdat)- 1; end; |
pillar62
資深會員 發表:9 回覆:324 積分:271 註冊:2002-04-15 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |