Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.03.31;
Скачать: CL | DM;

Вниз

Как получить количество дней в месяце учитывая высокосные года?   Найти похожие ветки 

 
Step[B.M.] ©   (2003-03-18 23:52) [0]

Спасибо.


 
Юрий Зотов ©   (2003-03-19 00:02) [1]

Кол-во дней в месяце Month (1..12) года Year (word):
MonthDays[IsLeapYear(Year), Month]



 
stone ©   (2003-03-19 09:17) [2]

Returns the number of days in a specified month of a specified year.

Unit

DateUtils

Category

datetime routines

Delphi syntax:

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).


 
Юрий Зотов ©   (2003-03-19 13:37) [3]

> stone © (19.03.03 09:17)

В D5?


 
REA ©   (2003-03-19 14:36) [4]

MonthDays: array [Boolean] of TDayTable =
((31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31),
(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31));

function IsLeapYear(Year: Word): Boolean;
begin
Result := (Year mod 4 = 0) and ((Year mod 100 <> 0) or (Year mod 400 = 0));
end;

function DaysInAMonth(const AYear, AMonth: Word): Word;
begin
Result := MonthDays[(AMonth = 2) and IsLeapYear(AYear), AMonth];
end;



 
stone ©   (2003-03-19 14:47) [5]

> В D5?

А что в D5 такого еще не было?




Страницы: 1 вся ветка

Текущий архив: 2003.03.31;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.018 c
7-100479
maxim2
2002-12-12 14:14
2003.03.31
Как узнать есть ли привод CD-ROM в компе


1-100252
BillyJeans
2003-03-18 18:05
2003.03.31
Как програмно отловить потерю фокуса?


14-100449
Delirium^.Tremens
2003-03-14 17:51
2003.03.31
Самовар не работает


6-100367
AlexandrK
2003-02-07 15:26
2003.03.31
Проблема в передаче АТ команд на сотовый, (Motorola timeport)


3-100169
Roki
2003-03-12 15:26
2003.03.31
Как в IB(FireBird) привести типы данных?